3 namespace Friendica\Core\Config;
6 * Interface for accessing system wide configurations
8 interface IConfiguration
12 * @brief Loads all configuration values of family into a cached storage.
14 * All configuration values of the system are stored in the cache ( @see ConfigCache )
16 * @param string $cat The category of the configuration value
20 function load(string $cat = 'config');
23 * @brief Get a particular user's config variable given the category name
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).
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)
35 * @return mixed Stored value or null if it does not exist
37 function get(string $cat, string $key, $default_value = null, bool $refresh = false);
40 * @brief Sets a configuration value for system config
42 * Stores a config value ($value) in the category ($cat) under the key ($key)
44 * Note: Please do not store booleans - convert to 0/1 integer values!
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
50 * @return bool Operation success
52 function set(string $cat, string $key, $value);
55 * @brief Deletes the given key from the system configuration.
57 * Removes the configured value from the stored cache in $this->configCache
58 * (@see ConfigCache) and removes it from the database (@see IConfigAdapter).
60 * @param string $cat The category of the configuration value
61 * @param string $key The configuration key to delete
65 function delete(string $cat, string $key);
68 * Returns the Config Cache
70 * @return Cache\ConfigCache