From 0506d2cb3b5a55823f4309fcc029b987b640679d Mon Sep 17 00:00:00 2001 From: Alex Pott <alex.a.pott@googlemail.com> Date: Fri, 7 Nov 2014 14:01:50 -0800 Subject: [PATCH] Issue #2370733 by chx: Fixed Contrib can not provide config storage. --- .../Core/Config/BootstrapConfigStorageFactory.php | 12 +++++++++--- core/lib/Drupal/Core/DrupalKernel.php | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/core/lib/Drupal/Core/Config/BootstrapConfigStorageFactory.php b/core/lib/Drupal/Core/Config/BootstrapConfigStorageFactory.php index 2462eaf74ef1..c2abc3ba86a2 100644 --- a/core/lib/Drupal/Core/Config/BootstrapConfigStorageFactory.php +++ b/core/lib/Drupal/Core/Config/BootstrapConfigStorageFactory.php @@ -18,16 +18,22 @@ class BootstrapConfigStorageFactory { /** * Returns a configuration storage implementation. * + * @param $class_loader + * The class loader. Normally Composer's ClassLoader, as included by the + * front controller, but may also be decorated; e.g., + * \Symfony\Component\ClassLoader\ApcClassLoader. + * * @return \Drupal\Core\Config\StorageInterface * A configuration storage implementation. */ - public static function get() { + public static function get($class_loader = NULL) { $bootstrap_config_storage = Settings::get('bootstrap_config_storage'); + $storage_backend = FALSE; if (!empty($bootstrap_config_storage) && is_callable($bootstrap_config_storage)) { - return call_user_func($bootstrap_config_storage); + $storage_backend = call_user_func($bootstrap_config_storage, $class_loader); } // Fallback to the DatabaseStorage. - return self::getDatabaseStorage(); + return $storage_backend ?: self::getDatabaseStorage(); } /** diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php index c014e4ad2541..600fd2164b01 100644 --- a/core/lib/Drupal/Core/DrupalKernel.php +++ b/core/lib/Drupal/Core/DrupalKernel.php @@ -1171,7 +1171,7 @@ protected function getConfigStorage() { // The active configuration storage may not exist yet; e.g., in the early // installer. Catch the exception thrown by config_get_config_directory(). try { - $this->configStorage = BootstrapConfigStorageFactory::get(); + $this->configStorage = BootstrapConfigStorageFactory::get($this->classLoader); } catch (\Exception $e) { $this->configStorage = new NullStorage(); -- GitLab