Neos\ContentRepository\Command\NodeCommandController::repairCommand PHP Метод

repairCommand() публичный Метод

This command analyzes and repairs the node tree structure and individual nodes based on the current node type configuration. It is possible to execute only one or more specific checks by providing the --skip or --only option. See the full description of checks further below for possible check identifiers. The following checks will be performed: {pluginDescriptions} Examples: ./flow node:repair ./flow node:repair --node-type Neos.NodeTypes:Page ./flow node:repair --workspace user-robert --only removeOrphanNodes,removeNodesWithInvalidDimensions ./flow node:repair --skip removeUndefinedProperties
public repairCommand ( string $nodeType = null, string $workspace = 'live', boolean $dryRun = false, boolean $cleanup = true, string $skip = null, string $only = null ) : void
$nodeType string Node type name, if empty update all declared node types
$workspace string Workspace name, default is 'live'
$dryRun boolean Don't do anything, but report actions
$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)
Результат void
    public function repairCommand($nodeType = null, $workspace = 'live', $dryRun = false, $cleanup = true, $skip = null, $only = null)
    {
        $this->pluginConfigurations = self::detectPlugins($this->objectManager);
        if ($this->workspaceRepository->countByName($workspace) === 0) {
            $this->outputLine('Workspace "%s" does not exist', array($workspace));
            exit(1);
        }
        if ($nodeType !== null) {
            if ($this->nodeTypeManager->hasNodeType($nodeType)) {
                $nodeType = $this->nodeTypeManager->getNodeType($nodeType);
            } else {
                $this->outputLine('Node type "%s" does not exist', array($nodeType));
                exit(1);
            }
        }
        if ($dryRun) {
            $this->outputLine('Dry run, not committing any changes.');
        }
        if (!$cleanup) {
            $this->outputLine('Omitting cleanup tasks.');
        }
        foreach ($this->pluginConfigurations as $pluginConfiguration) {
            /** @var NodeCommandControllerPluginInterface $plugin */
            $plugin = $pluginConfiguration['object'];
            $this->outputLine('<b>' . $plugin->getSubCommandShortDescription('repair') . '</b>');
            $this->outputLine();
            $plugin->invokeSubCommand('repair', $this->output, $nodeType, $workspace, $dryRun, $cleanup, $skip, $only);
            $this->outputLine();
        }
        $this->outputLine('Node repair finished.');
    }