class ExportCommand in Configuration Split 8
Class ExportCommand.
@package Drupal\config_split
@DrupalCommand ( extension="config_split", extensionType="module" )
Hierarchy
- class \Drupal\config_split\Command\SplitCommandBase extends \Drupal\Console\Core\Command\Command
- class \Drupal\config_split\Command\ExportCommand
Expanded class hierarchy of ExportCommand
1 string reference to 'ExportCommand'
1 service uses ExportCommand
File
- src/
Command/ ExportCommand.php, line 22
Namespace
Drupal\config_split\CommandView source
class ExportCommand extends SplitCommandBase {
/**
* {@inheritdoc}
*/
protected function configure() {
$this
->setName('config_split:export')
->setAliases([
'csex',
])
->setDescription($this
->trans('commands.config_split.export.description'))
->addOption('split', NULL, InputOption::VALUE_OPTIONAL);
}
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output) {
try {
// Make the magic happen.
$this->cliService
->ioExport($input
->getOption('split'), $this
->getIo(), [
$this,
't',
], $input
->getOption('yes'));
} catch (\Exception $e) {
$this
->getIo()
->error($e
->getMessage());
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ExportCommand:: |
protected | function | ||
ExportCommand:: |
protected | function | ||
SplitCommandBase:: |
protected | property | The cli service doing all the work. | |
SplitCommandBase:: |
public | function | The translation function akin to Drupal's t(). | |
SplitCommandBase:: |
public | function | Constructor with cli service injection. |