ResourceCommandController
class ResourceCommandController extends CommandController (View source)
PersistentResource command controller for the Neos.Flow package
Properties
protected Request | $request | from CommandController | |
protected Response | $response | from CommandController | |
protected Arguments | $arguments | from CommandController | |
protected string | $commandMethodName | Name of the command method |
from CommandController |
protected ObjectManagerInterface | $objectManager | ||
protected CommandManager | $commandManager | from CommandController | |
protected ConsoleOutput | $output | from CommandController | |
protected ResourceManager | $resourceManager | ||
protected ResourceRepository | $resourceRepository | ||
protected PersistenceManagerInterface | $persistenceManager | ||
protected PackageManager | $packageManager | ||
protected MessageCollector | $messageCollector |
Methods
Resolves and checks the current command method name
Initializes the arguments array of this controller by creating an empty argument object for each of the method arguments found in the designated command method.
Maps arguments delivered by the request object to the local controller arguments.
Forwards the request to another command and / or CommandController.
Calls the specified command method and passes the arguments.
Returns the CLI Flow command depending on the environment
Outputs specified text to the console window You can specify arguments that will be passed to the text via sprintf
Outputs specified text to the console window and appends a line break
Formats the given text to fit into MAXIMUM_LINE_LENGTH and outputs it to the console window
Exits the CLI through the dispatcher and makes sure that Flow is properly shut down.
Sends the response and exits the CLI without any further code execution Should be used for commands that flush code caches.
Publish resources
Copy resources
Clean up resource registry
This method is used internal as a callback method to clear doctrine states
Details
__construct()
Constructs the command controller
void
injectCommandManager(CommandManager $commandManager)
No description
void
injectObjectManager(ObjectManagerInterface $objectManager)
Injects the reflection service
protected string
resolveCommandMethodName()
Resolves and checks the current command method name
Note: The resulting command method name might not have the correct case, which isn't a problem because PHP is case insensitive regarding method names.
protected void
initializeCommandMethodArguments()
Initializes the arguments array of this controller by creating an empty argument object for each of the method arguments found in the designated command method.
protected void
mapRequestArgumentsToControllerArguments()
Maps arguments delivered by the request object to the local controller arguments.
protected void
forward(string $commandName, string $controllerObjectName = null, array $arguments = [])
Forwards the request to another command and / or CommandController.
Request is directly transferred to the other command / controller without the need for a new request.
protected void
callCommandMethod()
Calls the specified command method and passes the arguments.
If the command returns a string, it is appended to the content in the response object. If the command doesn't return anything and a valid view exists, the view is rendered automatically.
string
getFlowInvocationString()
Returns the CLI Flow command depending on the environment
protected void
output(string $text, array $arguments = [])
Outputs specified text to the console window You can specify arguments that will be passed to the text via sprintf
protected void
outputLine(string $text = '', array $arguments = [])
Outputs specified text to the console window and appends a line break
protected void
outputFormatted(string $text = '', array $arguments = [], int $leftPadding = 0)
Formats the given text to fit into MAXIMUM_LINE_LENGTH and outputs it to the console window
protected void
quit(int $exitCode = 0)
Exits the CLI through the dispatcher and makes sure that Flow is properly shut down.
If your command relies on functionality which is triggered through the Bootstrap shutdown (such as the persistence framework), you must use quit() instead of exit().
protected void
sendAndExit(int $exitCode = 0)
Sends the response and exits the CLI without any further code execution Should be used for commands that flush code caches.
void
publishCommand(string $collection = null)
Publish resources
This command publishes the resources of the given or - if none was specified, all - resource collections to their respective configured publishing targets.
void
copyCommand(string $sourceCollection, string $targetCollection, bool $publish = false)
Copy resources
This command copies all resources from one collection to another storage identified by name. The target storage must be empty and must not be identical to the current storage of the collection.
This command merely copies the binary data from one storage to another, it does not change the related PersistentResource objects in the database in any way. Since the PersistentResource objects in the database refer to a collection name, you can use this command for migrating from one storage to another my configuring the new storage with the name of the old storage collection after the resources have been copied.
void
cleanCommand()
Clean up resource registry
This command checks the resource registry (that is the database tables) for orphaned resource objects which don't seem to have any corresponding data anymore (for example: the file in Data/Persistent/Resources has been deleted without removing the related PersistentResource object).
If the Neos.Media package is active, this command will also detect any assets referring to broken resources and will remove the respective Asset object from the database when the broken resource is removed.
This command will ask you interactively what to do before deleting anything.
protected void
clearState(int $iteration)
This method is used internal as a callback method to clear doctrine states