You are here

class CliWorkaroundCommands in Tome 8

Contains logic for working around Drush bugs.

@todo Remove when https://github.com/drush-ops/drush/pull/3770 is closed.

@internal

Hierarchy

Expanded class hierarchy of CliWorkaroundCommands

1 string reference to 'CliWorkaroundCommands'
drush.services.yml in modules/tome_base/drush.services.yml
modules/tome_base/drush.services.yml
1 service uses CliWorkaroundCommands
cli.workaround in modules/tome_base/drush.services.yml
Drupal\tome_base\Commands\CliWorkaroundCommands

File

modules/tome_base/src/Commands/CliWorkaroundCommands.php, line 17

Namespace

Drupal\tome_base\Commands
View source
class CliWorkaroundCommands extends DrushCommands {

  /**
   * This tricks "drush php" into working for Symfony console commands.
   *
   * @hook pre-command php:cli
   */
  public function preCommand(CommandData $commandData) {
    foreach (Drush::getApplication()
      ->all('tome') as $name => $command) {
      if (!$command instanceof AnnotatedCommand) {
        $dupe_command = new AnnotatedCommand($name);
        $dupe_command
          ->setDefinition($command
          ->getDefinition());
        Drush::getApplication()
          ->add($dupe_command);
      }
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CliWorkaroundCommands::preCommand public function This tricks "drush php" into working for Symfony console commands.