mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-28 10:09:15 +02:00
[ticket/15287] Launch exception if storage is not available
PHPBB3-15287
This commit is contained in:
parent
ba8cda4d05
commit
e41d4b0d0c
@ -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.',
|
||||
|
@ -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()));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user