X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=vendor%2Fdrupal%2Fconsole-core%2Fsrc%2FBootstrap%2FDrupalConsoleCore.php;h=6bd718677d8f35490d1dc28eed275f3ec2dbd7a0;hb=4e1bfbf98b844da83b18aca92ef00f11a4735806;hp=16ad4f1d5c8ee635d8937424a7a9b3f422d55f2b;hpb=eba34333e3c89f208d2f72fa91351ad019a71583;p=yaffs-website diff --git a/vendor/drupal/console-core/src/Bootstrap/DrupalConsoleCore.php b/vendor/drupal/console-core/src/Bootstrap/DrupalConsoleCore.php index 16ad4f1d5..6bd718677 100644 --- a/vendor/drupal/console-core/src/Bootstrap/DrupalConsoleCore.php +++ b/vendor/drupal/console-core/src/Bootstrap/DrupalConsoleCore.php @@ -7,6 +7,7 @@ namespace Drupal\Console\Core\Bootstrap; +use Drupal\Console\Core\Utils\DrupalFinder; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; @@ -28,16 +29,26 @@ class DrupalConsoleCore */ protected $appRoot; + /** + * @var DrupalFinder + */ + protected $drupalFinder; + /** * DrupalConsole constructor. * - * @param $root - * @param $appRoot + * @param string $root + * @param string $appRoot + * @param DrupalFinder $drupalFinder */ - public function __construct($root, $appRoot = null) - { + public function __construct( + $root, + $appRoot = null, + DrupalFinder $drupalFinder + ) { $this->root = $root; $this->appRoot = $appRoot; + $this->drupalFinder = $drupalFinder; } /** @@ -48,11 +59,15 @@ class DrupalConsoleCore $container = new ContainerBuilder(); $loader = new YamlFileLoader($container, new FileLocator($this->root)); + if (substr($this->root, -1) === DIRECTORY_SEPARATOR) { + $this->root = substr($this->root, 0, -1); + } + $servicesFiles = [ - $this->root.DRUPAL_CONSOLE_CORE.'/services.yml', + $this->root.DRUPAL_CONSOLE_CORE.'services.yml', $this->root.'/services.yml', - $this->root.DRUPAL_CONSOLE.'/uninstall.services.yml', - $this->root.DRUPAL_CONSOLE.'/extend.console.uninstall.services.yml' + $this->root.DRUPAL_CONSOLE.'uninstall.services.yml', + $this->root.DRUPAL_CONSOLE.'extend.console.uninstall.services.yml' ]; foreach ($servicesFiles as $servicesFile) { @@ -82,6 +97,11 @@ class DrupalConsoleCore $consoleRoot ); + $container->set( + 'console.drupal_finder', + $this->drupalFinder + ); + $configurationManager = $container->get('console.configuration_manager'); $directory = $configurationManager->getConsoleDirectory() . 'extend/'; $autoloadFile = $directory . 'vendor/autoload.php';