Neos\Neos\Command\NodeCommandControllerPlugin::invokeSubCommand PHP Method

invokeSubCommand() public method

A method which runs the task implemented by the plugin for the given command
public invokeSubCommand ( string $controllerCommandName, ConsoleOutput $output, NodeType $nodeType = null, string $workspaceName = 'live', boolean $dryRun = false, boolean $cleanup = true, string $skip = null, string $only = null ) : void
$controllerCommandName string Name of the command in question, for example "repair"
$output Neos\Flow\Cli\ConsoleOutput An instance of ConsoleOutput which can be used for output or dialogues
$nodeType Neos\ContentRepository\Domain\Model\NodeType Only handle this node type (if specified)
$workspaceName string Only handle this workspace (if specified)
$dryRun boolean If TRUE, don't do any changes, just simulate what you would do
$cleanup boolean If FALSE, cleanup tasks are skipped
$skip string Skip the given check or checks (comma separated)
$only string Only execute the given check or checks (comma separated)
return void
    public function invokeSubCommand($controllerCommandName, ConsoleOutput $output, NodeType $nodeType = null, $workspaceName = 'live', $dryRun = false, $cleanup = true, $skip = null, $only = null)
    {
        $this->output = $output;
        $commandMethods = ['generateUriPathSegments' => ['cleanup' => false], 'removeContentDimensionsFromRootAndSitesNode' => ['cleanup' => true]];
        $skipCommandNames = Arrays::trimExplode(',', $skip === null ? '' : $skip);
        $onlyCommandNames = Arrays::trimExplode(',', $only === null ? '' : $only);
        switch ($controllerCommandName) {
            case 'repair':
                foreach ($commandMethods as $commandMethodName => $commandMethodConfiguration) {
                    if (in_array($commandMethodName, $skipCommandNames)) {
                        continue;
                    }
                    if ($onlyCommandNames !== [] && !in_array($commandMethodName, $onlyCommandNames)) {
                        continue;
                    }
                    if (!$cleanup && $commandMethodConfiguration['cleanup']) {
                        continue;
                    }
                    $this->{$commandMethodName}($workspaceName, $dryRun, $nodeType);
                }
        }
    }