class ImportCommand in Configuration Split 8
Class ImportCommand.
@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\ImportCommand
Expanded class hierarchy of ImportCommand
1 string reference to 'ImportCommand'
1 service uses ImportCommand
File
- src/
Command/ ImportCommand.php, line 22
Namespace
Drupal\config_split\CommandView source
class ImportCommand extends SplitCommandBase {
/**
* {@inheritdoc}
*/
protected function configure() {
$this
->setName('config_split:import')
->setAliases([
'csim',
])
->setDescription($this
->trans('commands.config_split.import.description'))
->addOption('split', NULL, InputOption::VALUE_OPTIONAL);
}
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output) {
try {
// Make the magic happen.
$this->cliService
->ioImport($input
->getOption('split'), $this
->getIo(), [
$this,
't',
], $input
->getOption('yes'));
} catch (\Exception $e) {
$this
->getIo()
->error($e
->getMessage());
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ImportCommand:: |
protected | function | ||
ImportCommand:: |
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. |