DrushServiceModfier.php

Namespace

Drush\Drupal

Classes

File

lib/Drush/Drupal/DrushServiceModfier.php
View source
  1. <?php
  2. namespace Drush\Drupal;
  3. use Drush\Log\LogLevel;
  4. use Drupal\Core\DependencyInjection\ServiceModifierInterface;
  5. use Drupal\Core\DependencyInjection\ContainerBuilder;
  6. class DrushServiceModfier implements ServiceModifierInterface
  7. {
  8. /**
  9. * @inheritdoc
  10. */
  11. public function alter(ContainerBuilder $container) {
  12. drush_log(dt("service modifier alter"), LogLevel::DEBUG);
  13. // http://symfony.com/doc/2.7/components/dependency_injection/tags.html#register-the-pass-with-the-container
  14. $container->register('drush.service.consolecommands', 'Drush\Command\ServiceCommandlist');
  15. $container->addCompilerPass(new FindCommandsCompilerPass('drush.service.consolecommands', 'console.command'));
  16. $container->register('drush.service.consolidationcommands', 'Drush\Command\ServiceCommandlist');
  17. $container->addCompilerPass(new FindCommandsCompilerPass('drush.service.consolidationcommands', 'consolidation.commandhandler'));
  18. }
  19. }