3 namespace Friendica\Core\Config;
\r
7 * @author Hypolite Petovan <mrpetovan@gmail.com>
\r
9 interface IConfigAdapter
\r
12 * @brief Loads all configuration values into a cached storage.
\r
14 * All configuration values of the system are stored in global cache
\r
15 * which is available under the global variable $a->config
\r
17 * @param string $cat The category of the configuration values to load
\r
21 public function load($cat = "config");
\r
24 * @brief Get a particular user's config variable given the category name
\r
25 * ($family) and a key.
\r
27 * Get a particular config value from the given category ($family)
\r
28 * and the $key from a cached storage in $a->config[$uid].
\r
29 * $instore is only used by the set_config function
\r
30 * to determine if the key already exists in the DB
\r
31 * If a key is found in the DB but doesn't exist in
\r
32 * local config cache, pull it into the cache so we don't have
\r
33 * to hit the DB again for this item.
\r
35 * @param string $cat The category of the configuration value
\r
36 * @param string $k The configuration key to query
\r
37 * @param mixed $default_value optional, The value to return if key is not set (default: null)
\r
38 * @param boolean $refresh optional, If true the config is loaded from the db and not from the cache (default: false)
\r
40 * @return mixed Stored value or null if it does not exist
\r
42 public function get($cat, $k, $default_value = null, $refresh = false);
\r
45 * @brief Sets a configuration value for system config
\r
47 * Stores a config value ($value) in the category ($family) under the key ($key)
\r
48 * for the user_id $uid.
\r
50 * Note: Please do not store booleans - convert to 0/1 integer values!
\r
52 * @param string $family The category of the configuration value
\r
53 * @param string $key The configuration key to set
\r
54 * @param mixed $value The value to store
\r
56 * @return mixed Stored $value or false if the database update failed
\r
58 public function set($cat, $k, $value);
\r
61 * @brief Deletes the given key from the system configuration.
\r
63 * Removes the configured value from the stored cache in $a->config
\r
64 * and removes it from the database.
\r
66 * @param string $cat The category of the configuration value
\r
67 * @param string $k The configuration key to delete
\r
71 public function delete($cat, $k);
\r