public function DrushServiceModfier::alter

master DrushServiceModfier.php public DrushServiceModfier::alter(ContainerBuilder $container)

@inheritdoc

File

lib/Drush/Drupal/DrushServiceModfier.php, line 14

Namespace

Drush\Drupal

Class

DrushServiceModfier

Code

public function alter(ContainerBuilder $container) {
  drush_log(dt("service modifier alter"), LogLevel::DEBUG);
  // http://symfony.com/doc/2.7/components/dependency_injection/tags.html#register-the-pass-with-the-container
  $container->register('drush.service.consolecommands', 'Drush\Command\ServiceCommandlist');
  $container->addCompilerPass(new FindCommandsCompilerPass('drush.service.consolecommands', 'console.command'));
  $container->register('drush.service.consolidationcommands', 'Drush\Command\ServiceCommandlist');
  $container->addCompilerPass(new FindCommandsCompilerPass('drush.service.consolidationcommands', 'consolidation.commandhandler'));
}