]> git.mxchange.org Git - friendica.git/blob - src/Core/Config/Adapter/IConfigAdapter.php
Config FollowUp
[friendica.git] / src / Core / Config / Adapter / IConfigAdapter.php
1 <?php
2
3 namespace Friendica\Core\Config\Adapter;
4
5 /**
6  *
7  * @author Hypolite Petovan <hypolite@mrpetovan.com>
8  */
9 interface IConfigAdapter
10 {
11         /**
12          * Loads all configuration values into a cached storage.
13          *
14          * @param string  $cat The category of the configuration values to load
15          *
16          * @return array
17          */
18         public function load($cat = "config");
19
20         /**
21          * Get a particular user's config variable given the category name
22          * ($family) and a key.
23          *
24          * @param string  $cat The category of the configuration value
25          * @param string  $key The configuration key to query
26          *
27          * @return mixed Stored value or "!<unset>!" if it does not exist
28          */
29         public function get($cat, $key);
30
31         /**
32          * Stores a config value ($value) in the category ($family) under the key ($key)
33          * for the user_id $uid.
34          *
35          * Note: Please do not store booleans - convert to 0/1 integer values!
36          *
37          * @param string $cat   The category of the configuration value
38          * @param string $key   The configuration key to set
39          * @param mixed  $value The value to store
40          *
41          * @return bool Operation success
42          */
43         public function set($cat, $key, $value);
44
45         /**
46          * Removes the configured value from the stored cache
47          * and removes it from the database.
48          *
49          * @param string $cat The category of the configuration value
50          * @param string $key   The configuration key to delete
51          *
52          * @return mixed
53          */
54         public function delete($cat, $key);
55
56         /**
57          * Checks, if the current adapter is connected to the backend
58          *
59          * @return bool
60          */
61         public function isConnected();
62 }