class CommandBase in Tome 8
Contains a base class for Tome commands.
@internal
Hierarchy
- class \Drupal\tome_base\CommandBase extends \Symfony\Component\Console\Command\Command uses ExecutableFinderTrait, ProcessTrait
Expanded class hierarchy of CommandBase
7 files declare their use of CommandBase
- CleanFilesCommand.php in modules/
tome_sync/ src/ Commands/ CleanFilesCommand.php - ExportCommand.php in modules/
tome_sync/ src/ Commands/ ExportCommand.php - ImportCommand.php in modules/
tome_sync/ src/ Commands/ ImportCommand.php - ImportCompleteCommand.php in modules/
tome_sync/ src/ Commands/ ImportCompleteCommand.php - StaticCommand.php in modules/
tome_static/ src/ Commands/ StaticCommand.php
File
- modules/
tome_base/ src/ CommandBase.php, line 15
Namespace
Drupal\tome_baseView source
class CommandBase extends Command {
use ProcessTrait;
use ExecutableFinderTrait;
/**
* The IO decorator.
*
* @var \Symfony\Component\Console\Style\SymfonyStyle
*/
protected $io;
/**
* The current executable path.
*
* @var string
*/
protected $executable;
/**
* {@inheritdoc}
*/
protected function initialize(InputInterface $input, OutputInterface $output) {
$this->io = new SymfonyStyle($input, $output);
$this->executable = $this
->findExecutable($input);
}
/**
* {@inheritdoc}
*/
protected function io() {
return $this->io;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CommandBase:: |
protected | property | The current executable path. | |
CommandBase:: |
protected | property | The IO decorator. | |
CommandBase:: |
protected | function | ||
CommandBase:: |
protected | function |
Returns the IO decorator, for reporting errors. Overrides ProcessTrait:: |
|
ExecutableFinderTrait:: |
protected | function | Finds an executable string for the current process. | |
ProcessTrait:: |
protected | function | Displays errors using the IO component. | |
ProcessTrait:: |
protected | function | Runs a single command and outputs errors if encountered. | |
ProcessTrait:: |
protected | function | Runs commands with concurrency. |