]> git.mxchange.org Git - friendica.git/blob - src/Model/Storage/IStorage.php
Add IStorage interface
[friendica.git] / src / Model / Storage / IStorage.php
1 <?php
2 /**
3  * @file src/Model/Storage/IStorage.php
4  * @brief Storage backend system
5  */
6
7 namespace Friendica\Model\Storage;
8
9 /**
10  * @brief Interface for storage backends
11  */
12 interface IStorage
13 {
14         /**
15          * @brief Get data from backend
16          * @param string  $ref  Data reference
17          * @return string
18      */
19         public static function get($ref);
20
21         /**
22          * @brief Put data in backend as $ref. If $ref is null a new reference is created.
23          * @param string  $data  Data to save
24          * @param string  $ref   Data referece. Optional.
25          * @return string Saved data referece
26          */
27         public static function put($data, $ref = null);
28
29         /**
30          * @brief Remove data from backend
31          * @param string  $ref  Data referece
32          * @return boolean  True on success
33          */
34         public static function delete($ref);
35 }