Neos\Flow\Command\ConfigurationCommandController::showCommand PHP Method

showCommand() public method

The command shows the configuration of the current context as it is used by Flow itself. You can specify the configuration type and path if you want to show parts of the configuration. ./flow configuration:show --type Settings --path Neos.Flow.persistence
public showCommand ( string $type = null, string $path = null ) : void
$type string Configuration type to show
$path string path to subconfiguration separated by "." like "Neos.Flow"
return void
    public function showCommand($type = null, $path = null)
    {
        $availableConfigurationTypes = $this->configurationManager->getAvailableConfigurationTypes();
        if (in_array($type, $availableConfigurationTypes)) {
            $configuration = $this->configurationManager->getConfiguration($type);
            if ($path !== null) {
                $configuration = Arrays::getValueByPath($configuration, $path);
            }
            $typeAndPath = $type . ($path ? ': ' . $path : '');
            if ($configuration === null) {
                $this->outputLine('<b>Configuration "%s" was empty!</b>', [$typeAndPath]);
            } else {
                $yaml = Yaml::dump($configuration, 99);
                $this->outputLine('<b>Configuration "%s":</b>', [$typeAndPath]);
                $this->outputLine();
                $this->outputLine($yaml . chr(10));
            }
        } else {
            if ($type !== null) {
                $this->outputLine('<b>Configuration type "%s" was not found!</b>', [$type]);
            }
            $this->outputLine('<b>Available configuration types:</b>');
            foreach ($availableConfigurationTypes as $availableConfigurationType) {
                $this->outputLine('  ' . $availableConfigurationType);
            }
            $this->outputLine();
            $this->outputLine('Hint: <b>%s configuration:show --type <configurationType></b>', [$this->getFlowInvocationString()]);
            $this->outputLine('      shows the configuration of the specified type.');
        }
    }