diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 1414f0fd1a..006582772a 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -727,6 +727,7 @@ $lang = array_merge($lang, array( 'SUBJECT' => 'Subject', 'SUBMIT' => 'Submit', + 'STORAGE_ADAPTER_NOT_AVAILABLE' => 'Selected storage is not available.', 'STORAGE_FILE_EXISTS' => 'File already exists.', 'STORAGE_FILE_NO_EXIST' => 'File does not exist.', 'STORAGE_CANNOT_WRITE_FILE' => 'Can not write to file.', diff --git a/phpBB/phpbb/storage/adapter_factory.php b/phpBB/phpbb/storage/adapter_factory.php index 429437ab28..85a3ef03f7 100644 --- a/phpBB/phpbb/storage/adapter_factory.php +++ b/phpBB/phpbb/storage/adapter_factory.php @@ -15,6 +15,7 @@ namespace phpbb\storage; use phpbb\config\config; use phpbb\di\service_collection; +use phpbb\storage\exception\exception; class adapter_factory { @@ -59,6 +60,11 @@ class adapter_factory $provider_class = $this->config['storage\\' . $storage_name . '\\adapter']; $provider = $this->providers->get_by_class($provider_class); + if (!$provider->is_available()) + { + throw new exception('STORAGE_ADAPTER_NOT_AVAILABLE'); + } + $adapter = $this->adapters->get_by_class($provider->get_adapter_class()); $adapter->configure($this->build_options($storage_name, $provider->get_options()));