2018-11-21 09:36:31 +01:00
|
|
|
<?php
|
|
|
|
/**
|
2021-03-29 08:40:20 +02:00
|
|
|
* @copyright Copyright (C) 2010-2021, the Friendica project
|
2020-02-09 15:45:36 +01:00
|
|
|
*
|
|
|
|
* @license GNU AGPL version 3 or any later version
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License as
|
|
|
|
* published by the Free Software Foundation, either version 3 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*
|
2018-11-21 09:36:31 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
namespace Friendica\Model\Storage;
|
|
|
|
|
|
|
|
/**
|
2021-08-01 13:06:19 +02:00
|
|
|
* Interface for basic storage backends
|
2018-11-21 09:36:31 +01:00
|
|
|
*/
|
|
|
|
interface IStorage
|
|
|
|
{
|
|
|
|
/**
|
2020-01-19 07:05:23 +01:00
|
|
|
* Get data from backend
|
2020-01-05 01:58:49 +01:00
|
|
|
*
|
|
|
|
* @param string $reference Data reference
|
|
|
|
*
|
2018-11-21 09:36:31 +01:00
|
|
|
* @return string
|
2018-12-08 18:49:16 +01:00
|
|
|
*
|
2021-08-01 13:06:19 +02:00
|
|
|
* @throws StorageException in case there's an unexpected error
|
|
|
|
* @throws ReferenceStorageException in case the reference doesn't exist
|
2018-12-08 18:49:16 +01:00
|
|
|
*/
|
2021-08-01 13:06:19 +02:00
|
|
|
public function get(string $reference): string;
|
2018-12-08 18:49:16 +01:00
|
|
|
|
2020-01-05 01:58:49 +01:00
|
|
|
/**
|
|
|
|
* The name of the backend
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function __toString();
|
2020-01-06 17:42:28 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The name of the backend
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
2021-08-01 13:06:19 +02:00
|
|
|
public static function getName(): string;
|
2020-01-05 01:58:49 +01:00
|
|
|
}
|