mirror of
https://github.com/friendica/friendica
synced 2025-04-26 10:30:11 +00:00
Rename ISelectableStorage to IWritableStorage
This commit is contained in:
parent
eb035771f1
commit
d0536ebea7
16 changed files with 64 additions and 63 deletions
|
@ -284,7 +284,7 @@ class Attach
|
|||
$items = self::selectToArray(['backend-class','backend-ref'], $conditions);
|
||||
|
||||
foreach($items as $item) {
|
||||
$backend_class = DI::storageManager()->getSelectableStorageByName($item['backend-class'] ?? '');
|
||||
$backend_class = DI::storageManager()->getWritableStorageByName($item['backend-class'] ?? '');
|
||||
if (!empty($backend_class)) {
|
||||
$fields['backend-ref'] = $backend_class->put($img->asString(), $item['backend-ref'] ?? '');
|
||||
} else {
|
||||
|
@ -316,7 +316,7 @@ class Attach
|
|||
$items = self::selectToArray(['backend-class','backend-ref'], $conditions);
|
||||
|
||||
foreach($items as $item) {
|
||||
$backend_class = DI::storageManager()->getSelectableStorageByName($item['backend-class'] ?? '');
|
||||
$backend_class = DI::storageManager()->getWritableStorageByName($item['backend-class'] ?? '');
|
||||
if (!empty($backend_class)) {
|
||||
try {
|
||||
$backend_class->delete($item['backend-ref'] ?? '');
|
||||
|
|
|
@ -347,7 +347,7 @@ class Photo
|
|||
|
||||
if (DBA::isResult($existing_photo)) {
|
||||
$backend_ref = (string)$existing_photo["backend-ref"];
|
||||
$storage = DI::storageManager()->getSelectableStorageByName($existing_photo["backend-class"] ?? '');
|
||||
$storage = DI::storageManager()->getWritableStorageByName($existing_photo["backend-class"] ?? '');
|
||||
} else {
|
||||
$storage = DI::storage();
|
||||
}
|
||||
|
@ -411,7 +411,7 @@ class Photo
|
|||
$photos = DBA::select('photo', ['id', 'backend-class', 'backend-ref'], $conditions);
|
||||
|
||||
while ($photo = DBA::fetch($photos)) {
|
||||
$backend_class = DI::storageManager()->getSelectableStorageByName($photo['backend-class'] ?? '');
|
||||
$backend_class = DI::storageManager()->getWritableStorageByName($photo['backend-class'] ?? '');
|
||||
if (!empty($backend_class)) {
|
||||
try {
|
||||
$backend_class->delete($item['backend-ref'] ?? '');
|
||||
|
@ -448,7 +448,7 @@ class Photo
|
|||
$photos = self::selectToArray(['backend-class', 'backend-ref'], $conditions);
|
||||
|
||||
foreach($photos as $photo) {
|
||||
$backend_class = DI::storageManager()->getSelectableStorageByName($photo['backend-class'] ?? '');
|
||||
$backend_class = DI::storageManager()->getWritableStorageByName($photo['backend-class'] ?? '');
|
||||
if (!empty($backend_class)) {
|
||||
$fields["backend-ref"] = $backend_class->put($img->asString(), $photo['backend-ref']);
|
||||
} else {
|
||||
|
|
|
@ -29,7 +29,7 @@ use Friendica\Database\Database as DBA;
|
|||
*
|
||||
* This class manage data stored in database table.
|
||||
*/
|
||||
class Database implements ISelectableStorage
|
||||
class Database implements IWritableStorage
|
||||
{
|
||||
const NAME = 'Database';
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ use Friendica\Util\Strings;
|
|||
* Each new resource gets a value as reference and is saved in a
|
||||
* folder tree stucture created from that value.
|
||||
*/
|
||||
class Filesystem implements ISelectableStorage
|
||||
class Filesystem implements IWritableStorage
|
||||
{
|
||||
const NAME = 'Filesystem';
|
||||
|
||||
|
|
|
@ -22,12 +22,12 @@
|
|||
namespace Friendica\Model\Storage;
|
||||
|
||||
/**
|
||||
* Interface for selectable storage backends
|
||||
* Interface for writable storage backends
|
||||
*
|
||||
* Used for storages with CRUD functionality, mainly used for user data (e.g. photos, attachements).
|
||||
* There's only one active, selectable storage possible and can be selected by the current administrator
|
||||
* There's only one active, writable storage possible. This type of storages are selectable by the current administrator
|
||||
*/
|
||||
interface ISelectableStorage extends IStorage
|
||||
interface IWritableStorage extends IStorage
|
||||
{
|
||||
/**
|
||||
* Put data in backend as $ref. If $ref is not defined a new reference is created.
|
Loading…
Add table
Add a link
Reference in a new issue