X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=vendor%2Fdrupal%2Fconsole%2Fsrc%2FBootstrap%2FAddServicesCompilerPass.php;h=1cc60db486444262af822e90d13a4a2be05bacea;hb=1270d9129ce8f27c9b28b10518e32132c58e0aca;hp=e86f85d2796ddfb7f4356f7b662d5125d900cede;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/vendor/drupal/console/src/Bootstrap/AddServicesCompilerPass.php b/vendor/drupal/console/src/Bootstrap/AddServicesCompilerPass.php index e86f85d27..1cc60db48 100644 --- a/vendor/drupal/console/src/Bootstrap/AddServicesCompilerPass.php +++ b/vendor/drupal/console/src/Bootstrap/AddServicesCompilerPass.php @@ -2,6 +2,7 @@ namespace Drupal\Console\Bootstrap; +use Drupal\Console\Utils\Site; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; use Symfony\Component\DependencyInjection\ContainerBuilder; @@ -56,23 +57,32 @@ class AddServicesCompilerPass implements CompilerPassInterface new FileLocator($this->root) ); - $loader->load($this->root. DRUPAL_CONSOLE_CORE . 'services.yml'); - $loader->load($this->root. DRUPAL_CONSOLE . 'services-drupal-install.yml'); - $loader->load($this->root. DRUPAL_CONSOLE . 'services.yml'); + $servicesFiles = [ + $this->root. DRUPAL_CONSOLE_CORE . 'services.yml', + $this->root. DRUPAL_CONSOLE . 'uninstall.services.yml', + $this->root. DRUPAL_CONSOLE . 'services.yml', +// $this->root. DRUPAL_CONSOLE . 'extend.console.uninstall.services.yml', + ]; + + foreach ($servicesFiles as $servicesFile) { + if (file_exists($servicesFile)) { + $loader->load($servicesFile); + } + } $container->get('console.configuration_manager') ->loadConfiguration($this->root) ->getConfiguration(); - $cacheDirectory = $container->get('console.site')->getCacheDirectory(); - $consoleServicesFile = $cacheDirectory.'/console.services.yml'; + /** + * @var Site $site + */ + $site = $container->get('console.site'); - if (!$this->rebuild && file_exists($consoleServicesFile)) { - $loader->load($consoleServicesFile); + if (!$this->rebuild && $site->cachedServicesFileExists()) { + $loader->load($site->cachedServicesFile()); } else { - if (file_exists($consoleServicesFile)) { - unlink($consoleServicesFile); - } + $site->removeCachedServicesFile(); $finder = new Finder(); $finder->files() ->name('*.yml') @@ -149,15 +159,16 @@ class AddServicesCompilerPass implements CompilerPassInterface } } - if ($servicesData && is_writable($cacheDirectory)) { + if ($servicesData && is_writable($site->getCacheDirectory())) { file_put_contents( - $consoleServicesFile, + $site->cachedServicesFile(), Yaml::dump($servicesData, 4, 2) ); } } - $consoleExtendServicesFile = $this->root. DRUPAL_CONSOLE .'/extend.console.services.yml'; + $consoleExtendServicesFile = $this->root . DRUPAL_CONSOLE . '/extend.console.services.yml'; + if (file_exists($consoleExtendServicesFile)) { $loader->load($consoleExtendServicesFile); }