3 * System Configuration Class
5 * @file include/Core/Config.php
7 * @brief Contains the class with methods for system configuration
9 namespace Friendica\Core;
11 use Friendica\BaseObject;
12 use Friendica\Core\Config\Configuration;
15 * @brief Arbitrary system configuration storage
18 * If we ever would decide to return exactly the variable type as entered,
19 * we will have fun with the additional features. :-)
21 class Config extends BaseObject
24 * @brief Loads all configuration values of family into a cached storage.
26 * @param string $cat The category of the configuration value
30 public static function load($cat = "config")
32 self::getClass(Configuration::class)->load($cat);
36 * @brief Get a particular user's config variable given the category name
37 * ($family) and a key.
39 * @param string $cat The category of the configuration value
40 * @param string $key The configuration key to query
41 * @param mixed $default_value optional, The value to return if key is not set (default: null)
42 * @param boolean $refresh optional, If true the config is loaded from the db and not from the cache (default: false)
44 * @return mixed Stored value or null if it does not exist
46 public static function get($cat, $key, $default_value = null, $refresh = false)
48 return self::getClass(Configuration::class)->get($cat, $key, $default_value, $refresh);
52 * @brief Sets a configuration value for system config
54 * Stores a config value ($value) in the category ($cat) under the key ($key)
56 * Note: Please do not store booleans - convert to 0/1 integer values!
58 * @param string $cat The category of the configuration value
59 * @param string $key The configuration key to set
60 * @param mixed $value The value to store
62 * @return bool Operation success
64 public static function set($cat, $key, $value)
66 return self::getClass(Configuration::class)->set($cat, $key, $value);
70 * @brief Deletes the given key from the system configuration.
72 * @param string $cat The category of the configuration value
73 * @param string $key The configuration key to delete
77 public static function delete($cat, $key)
79 return self::getClass(Configuration::class)->delete($cat, $key);