You are here

class CommandBase in Tome 8

Contains a base class for Tome commands.

@internal

Hierarchy

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

... See full list

File

modules/tome_base/src/CommandBase.php, line 15

Namespace

Drupal\tome_base
View 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

Namesort descending Modifiers Type Description Overrides
CommandBase::$executable protected property The current executable path.
CommandBase::$io protected property The IO decorator.
CommandBase::initialize protected function
CommandBase::io protected function Returns the IO decorator, for reporting errors. Overrides ProcessTrait::io
ExecutableFinderTrait::findExecutable protected function Finds an executable string for the current process.
ProcessTrait::displayErrors protected function Displays errors using the IO component.
ProcessTrait::runCommand protected function Runs a single command and outputs errors if encountered.
ProcessTrait::runCommands protected function Runs commands with concurrency.