Version 1
[yaffs-website] / vendor / drush / drush / lib / Drush / Drupal / DrushServiceModfier.php
diff --git a/vendor/drush/drush/lib/Drush/Drupal/DrushServiceModfier.php b/vendor/drush/drush/lib/Drush/Drupal/DrushServiceModfier.php
new file mode 100644 (file)
index 0000000..7d6dec4
--- /dev/null
@@ -0,0 +1,22 @@
+<?php
+
+namespace Drush\Drupal;
+
+use Drush\Log\LogLevel;
+use Drupal\Core\DependencyInjection\ServiceModifierInterface;
+use Drupal\Core\DependencyInjection\ContainerBuilder;
+
+class DrushServiceModfier implements ServiceModifierInterface
+{
+    /**
+     * @inheritdoc
+     */
+    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', 'drush.command'));
+        $container->register('drush.service.consolidationcommands', 'Drush\Command\ServiceCommandlist');
+        $container->addCompilerPass(new FindCommandsCompilerPass('drush.service.consolidationcommands', 'consolidation.commandhandler'));
+    }
+}