mirror of
https://github.com/friendica/friendica
synced 2025-04-24 09:50:11 +00:00
Check that provided class implements IStorage in StorageManager::setBackend
- Add notice in admin if setting value change failed - Add notice in console if setting value change failed
This commit is contained in:
parent
f225a6c51a
commit
7e2e2f425e
3 changed files with 15 additions and 3 deletions
|
@ -54,12 +54,18 @@ class StorageManager
|
|||
* @brief Set current storage backend class
|
||||
*
|
||||
* @param string $class Backend class name
|
||||
* @return bool
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function setBackend($class)
|
||||
{
|
||||
/// @todo Check that $class implements IStorage
|
||||
if (!in_array('Friendica\Model\Storage\IStorage', class_implements($class))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Config::set('storage', 'class', $class);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue