]> git.mxchange.org Git - friendica.git/blob - src/Core/Config/Cache/IConfigCache.php
Merge pull request #6704 from tobiasd/20190220-credits
[friendica.git] / src / Core / Config / Cache / IConfigCache.php
1 <?php
2
3 namespace Friendica\Core\Config\Cache;
4
5 /**
6  * The interface for a system-wide ConfigCache
7  */
8 interface IConfigCache
9 {
10         /**
11          * Tries to load the specified configuration array into the config array.
12          * Doesn't overwrite previously set values by default to prevent default config files to supersede DB Config.
13          *
14          * @param array $config
15          * @param bool  $overwrite Force value overwrite if the config key already exists
16          */
17         function load(array $config, $overwrite = false);
18
19         /**
20          * Gets a value from the config cache.
21          *
22          * @param string $cat     Config category
23          * @param string $key     Config key
24          *
25          * @return null|mixed Returns the value of the Config entry or null if not set
26          */
27         function get($cat, $key = null);
28
29         /**
30          * Sets a value in the config cache. Accepts raw output from the config table
31          *
32          * @param string $cat   Config category
33          * @param string $key   Config key
34          * @param mixed  $value Value to set
35          *
36          * @return bool True, if the value is set
37          */
38         function set($cat, $key, $value);
39
40         /**
41          * Deletes a value from the config cache.
42          *
43          * @param string $cat  Config category
44          * @param string $key  Config key
45          *
46          * @return bool true, if deleted
47          */
48         function delete($cat, $key);
49
50         /**
51          * Returns the whole configuration cache
52          *
53          * @return array
54          */
55         function getAll();
56 }