Issue #2370733 by chx: Fixed Contrib can not provide config storage.
parent
338c7914d2
commit
0506d2cb3b
|
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1171,7 +1171,7 @@ class DrupalKernel implements DrupalKernelInterface, TerminableInterface {
|
|||
// 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();
|
||||
|
|
Loading…
Reference in New Issue