mirror of
https://github.com/friendica/friendica
synced 2025-04-28 22:24:22 +02:00
Add IStorage interface
storage classes should implement this interface
This commit is contained in:
parent
3b3c4e8cc7
commit
9b2e3fa916
2 changed files with 46 additions and 10 deletions
35
src/Model/Storage/IStorage.php
Normal file
35
src/Model/Storage/IStorage.php
Normal file
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
/**
|
||||
* @file src/Model/Storage/IStorage.php
|
||||
* @brief Storage backend system
|
||||
*/
|
||||
|
||||
namespace Friendica\Model\Storage;
|
||||
|
||||
/**
|
||||
* @brief Interface for storage backends
|
||||
*/
|
||||
interface IStorage
|
||||
{
|
||||
/**
|
||||
* @brief Get data from backend
|
||||
* @param string $ref Data reference
|
||||
* @return string
|
||||
*/
|
||||
public static function get($ref);
|
||||
|
||||
/**
|
||||
* @brief Put data in backend as $ref. If $ref is null a new reference is created.
|
||||
* @param string $data Data to save
|
||||
* @param string $ref Data referece. Optional.
|
||||
* @return string Saved data referece
|
||||
*/
|
||||
public static function put($data, $ref = null);
|
||||
|
||||
/**
|
||||
* @brief Remove data from backend
|
||||
* @param string $ref Data referece
|
||||
* @return boolean True on success
|
||||
*/
|
||||
public static function delete($ref);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue