Allow set empty string storge class for legacy

Legacy storage is defined by an empty string.
`StorageManager::setBackend()` now accept an empty string as a valid
backend storage.
This commit is contained in:
fabrixxm 2019-04-09 16:32:15 +02:00
parent 3aa8a255c9
commit b2794bb2c9
1 changed files with 4 additions and 2 deletions

View File

@ -29,7 +29,8 @@ class StorageManager
} }
/** /**
* @brief Return current storage backend class * @brief Return current storage backend class
*
* @return string * @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException * @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
@ -52,6 +53,7 @@ class StorageManager
/** /**
* @brief Set current storage backend class * @brief Set current storage backend class
* If $class is an empty string, legacy db storage is used.
* *
* @param string $class Backend class name * @param string $class Backend class name
* @return bool * @return bool
@ -59,7 +61,7 @@ class StorageManager
*/ */
public static function setBackend($class) public static function setBackend($class)
{ {
if (!in_array('Friendica\Model\Storage\IStorage', class_implements($class))) { if ($class !== "" && !in_array('Friendica\Model\Storage\IStorage', class_implements($class))) {
return false; return false;
} }