]> git.mxchange.org Git - friendica.git/blob - src/Core/Config/Adapter/IConfigAdapter.php
Merge pull request #6678 from rabuzarus/20190217_-_fix_magicLinks_mentions
[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 and returns the loaded category as an array.
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 system-wide 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          *
34          * Note: Please do not store booleans - convert to 0/1 integer values!
35          *
36          * @param string $cat   The category of the configuration value
37          * @param string $key   The configuration key to set
38          * @param mixed  $value The value to store
39          *
40          * @return bool Operation success
41          */
42         public function set($cat, $key, $value);
43
44         /**
45          * Removes the configured value from the stored cache
46          * and removes it from the database.
47          *
48          * @param string $cat The category of the configuration value
49          * @param string $key   The configuration key to delete
50          *
51          * @return mixed
52          */
53         public function delete($cat, $key);
54
55         /**
56          * Checks, if the current adapter is connected to the backend
57          *
58          * @return bool
59          */
60         public function isConnected();
61
62         /**
63          * Checks, if a config key ($key) in the category ($cat) is already loaded.
64          *
65          * @param string $cat The configuration category
66          * @param string $key The configuration key
67          *
68          * @return bool
69          */
70         public function isLoaded($cat, $key);
71 }