- Fixing SystemResource

- Adding tests for StorageManager
- Updating doc
This commit is contained in:
nupplaPhil 2020-01-06 17:42:28 +01:00
parent cc501439af
commit dbd5b5bb6e
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
12 changed files with 547 additions and 59 deletions

View file

@ -16,6 +16,7 @@ use Friendica\Database\DBA;
use Friendica\Database\DBStructure;
use Friendica\DI;
use Friendica\Model\Storage\IStorage;
use Friendica\Model\Storage\SystemResource;
use Friendica\Object\Image;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Images;
@ -223,7 +224,7 @@ class Photo
$values = array_fill(0, count($fields), "");
$photo = array_combine($fields, $values);
$photo["backend-class"] = Storage\SystemResource::class;
$photo["backend-class"] = SystemResource::NAME;
$photo["backend-ref"] = $filename;
$photo["type"] = $mimetype;
$photo["cacheable"] = false;
@ -275,7 +276,7 @@ class Photo
if (DBA::isResult($existing_photo)) {
$backend_ref = (string)$existing_photo["backend-ref"];
$storage = DI::facStorage()->getByName((string)$existing_photo["backend-class"]);
$storage = DI::facStorage()->getByName($existing_photo["backend-class"] ?? '');
} else {
$storage = DI::storage();
}