mirror of
https://github.com/friendica/friendica
synced 2025-04-21 09:50:11 +00:00
Make Storage testable & add tests
- Making StorageManager dynamic (DI::facStorage()) - Making concrete Storage dynamic (DI::storage()) - Add tests for Storage backend and failure handling - Bumping Level-2/Dice to "dev-master" until new release - Using Storage-Names instead of Storage-Classes in config (includes migration)
This commit is contained in:
parent
a5895f8623
commit
08edeae2f9
18 changed files with 744 additions and 242 deletions
|
@ -186,13 +186,8 @@ class Attach
|
|||
$filesize = strlen($data);
|
||||
}
|
||||
|
||||
/** @var IStorage $backend_class */
|
||||
$backend_class = StorageManager::getBackend();
|
||||
$backend_ref = '';
|
||||
if ($backend_class !== '') {
|
||||
$backend_ref = $backend_class::put($data);
|
||||
$data = '';
|
||||
}
|
||||
$backend_ref = DI::storage()->put($data);
|
||||
$data = '';
|
||||
|
||||
$hash = System::createGUID(64);
|
||||
$created = DateTimeFormat::utcNow();
|
||||
|
@ -210,7 +205,7 @@ class Attach
|
|||
'allow_gid' => $allow_gid,
|
||||
'deny_cid' => $deny_cid,
|
||||
'deny_gid' => $deny_gid,
|
||||
'backend-class' => $backend_class,
|
||||
'backend-class' => (string)DI::storage(),
|
||||
'backend-ref' => $backend_ref
|
||||
];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue