mirror of
https://github.com/friendica/friendica
synced 2025-04-26 21:10:16 +00:00
New class for external resources
This commit is contained in:
parent
96809b3fdd
commit
9276f6823b
5 changed files with 134 additions and 15 deletions
|
@ -126,6 +126,9 @@ class StorageManager
|
|||
case Storage\SystemResource::getName():
|
||||
$this->backendInstances[$name] = new Storage\SystemResource();
|
||||
break;
|
||||
case Storage\ExternalResource::getName():
|
||||
$this->backendInstances[$name] = new Storage\ExternalResource();
|
||||
break;
|
||||
default:
|
||||
$data = [
|
||||
'name' => $name,
|
||||
|
@ -158,7 +161,7 @@ class StorageManager
|
|||
public function isValidBackend(string $name = null, bool $onlyUserBackend = false)
|
||||
{
|
||||
return array_key_exists($name, $this->backends) ||
|
||||
(!$onlyUserBackend && $name === Storage\SystemResource::getName());
|
||||
(!$onlyUserBackend && in_array($name, [Storage\SystemResource::getName(), Storage\ExternalResource::getName()]));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue