]> git.mxchange.org Git - friendica.git/blob - src/Core/Config/Adapter/IConfigAdapter.php
Merge branch 'master' into develop
[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          * Note: Boolean variables are defined as 0/1 in the database
25          *
26          * @param string  $cat The category of the configuration value
27          * @param string  $key The configuration key to query
28          *
29          * @return null|mixed Stored value or null if it does not exist
30          */
31         public function get($cat, $key);
32
33         /**
34          * Stores a config value ($value) in the category ($family) under the key ($key).
35          *
36          * Note: Please do not store booleans - convert to 0/1 integer values!
37          *
38          * @param string $cat   The category of the configuration value
39          * @param string $key   The configuration key to set
40          * @param mixed  $value The value to store
41          *
42          * @return bool Operation success
43          */
44         public function set($cat, $key, $value);
45
46         /**
47          * Removes the configured value from the stored cache
48          * and removes it from the database.
49          *
50          * @param string $cat The category of the configuration value
51          * @param string $key The configuration key to delete
52          *
53          * @return bool Operation success
54          */
55         public function delete($cat, $key);
56
57         /**
58          * Checks, if the current adapter is connected to the backend
59          *
60          * @return bool
61          */
62         public function isConnected();
63
64         /**
65          * Checks, if a config key ($key) in the category ($cat) is already loaded.
66          *
67          * @param string $cat The configuration category
68          * @param string $key The configuration key
69          *
70          * @return bool
71          */
72         public function isLoaded($cat, $key);
73 }