]> git.mxchange.org Git - friendica.git/blob - src/Core/Config/IConfiguration.php
Remove unused killme()
[friendica.git] / src / Core / Config / IConfiguration.php
1 <?php
2
3 namespace Friendica\Core\Config;
4
5 /**
6  * Interface for accessing system wide configurations
7  */
8 interface IConfiguration
9 {
10
11         /**
12          * @brief Loads all configuration values of family into a cached storage.
13          *
14          * All configuration values of the system are stored in the cache ( @see ConfigCache )
15          *
16          * @param string $cat The category of the configuration value
17          *
18          * @return void
19          */
20         function load(string $cat = 'config');
21
22         /**
23          * @brief Get a particular user's config variable given the category name
24          * ($cat) and a $key.
25          *
26          * Get a particular config value from the given category ($cat)
27          * and the $key from a cached storage either from the $this->configAdapter
28          * (@see IConfigAdapter) or from the $this->configCache (@see ConfigCache).
29          *
30          * @param string  $cat        The category of the configuration value
31          * @param string  $key           The configuration key to query
32          * @param mixed   $default_value optional, The value to return if key is not set (default: null)
33          * @param boolean $refresh       optional, If true the config is loaded from the db and not from the cache (default: false)
34          *
35          * @return mixed Stored value or null if it does not exist
36          */
37         function get(string $cat, string $key, $default_value = null, bool $refresh = false);
38
39         /**
40          * @brief Sets a configuration value for system config
41          *
42          * Stores a config value ($value) in the category ($cat) under the key ($key)
43          *
44          * Note: Please do not store booleans - convert to 0/1 integer values!
45          *
46          * @param string $cat The category of the configuration value
47          * @param string $key    The configuration key to set
48          * @param mixed  $value  The value to store
49          *
50          * @return bool Operation success
51          */
52         function set(string $cat, string $key, $value);
53
54         /**
55          * @brief Deletes the given key from the system configuration.
56          *
57          * Removes the configured value from the stored cache in $this->configCache
58          * (@see ConfigCache) and removes it from the database (@see IConfigAdapter).
59          *
60          * @param string $cat The category of the configuration value
61          * @param string $key    The configuration key to delete
62          *
63          * @return bool
64          */
65         function delete(string $cat, string $key);
66
67         /**
68          * Returns the Config Cache
69          *
70          * @return Cache\ConfigCache
71          */
72         function getCache();
73 }