public function FeaturesCommands::status in Features 8.4
Same name and namespace in other branches
- 8.3 src/Commands/FeaturesCommands.php \Drupal\features\Commands\FeaturesCommands::status()
Display current Features settings.
@command features:status
@option bundle Use a specific bundle namespace.
@aliases fs,features-status
Parameters
string $keys: A possibly empty, comma-separated, list of config information to display.
File
- src/
Commands/ FeaturesCommands.php, line 177
Class
- FeaturesCommands
- Drush commands for Features.
Namespace
Drupal\features\CommandsCode
public function status($keys = NULL, array $options = self::OPTIONS_STATUS) {
$this
->featuresOptions($options);
$currentBundle = $this->assigner
->getBundle();
$export_settings = $this->manager
->getExportSettings();
$methods = $this->assigner
->getEnabledAssigners();
$output = $this
->output();
if ($currentBundle
->isDefault()) {
$output
->writeln(dt('Current bundle: none'));
}
else {
$output
->writeln(dt('Current bundle: @name (@machine_name)', [
'@name' => $currentBundle
->getName(),
'@machine_name' => $currentBundle
->getMachineName(),
]));
}
$output
->writeln(dt('Export folder: @folder', [
'@folder' => $export_settings['folder'],
]));
$output
->writeln(dt('The following assignment methods are enabled:'));
$output
->writeln(dt(' @methods', [
'@methods' => implode(', ', array_keys($methods)),
]));
if (!empty($keys)) {
$config = $this->manager
->getConfigCollection();
$keys = StringUtils::csvToArray($keys);
$data = count($keys) > 1 ? array_keys($config) : $config[$keys[0]];
$output
->writeln(print_r($data, TRUE));
}
}