3 namespace Friendica\Core\Config;
7 * @author Hypolite Petovan <hypolite@mrpetovan.com>
9 interface IConfigAdapter
12 * Loads all configuration values into a cached storage.
14 * @param string $cat The category of the configuration values to load
18 public function load($cat = "config");
21 * Get a particular user's config variable given the category name
22 * ($family) and a key.
24 * @param string $cat The category of the configuration value
25 * @param string $k The configuration key to query
26 * @param mixed $default_value optional, The value to return if key is not set (default: null)
27 * @param boolean $refresh optional, If true the config is loaded from the db and not from the cache (default: false)
29 * @return mixed Stored value or null if it does not exist
31 public function get($cat, $k, $default_value = null, $refresh = false);
34 * Stores a config value ($value) in the category ($family) under the key ($key)
35 * for the user_id $uid.
37 * Note: Please do not store booleans - convert to 0/1 integer values!
39 * @param string $cat The category of the configuration value
40 * @param string $k The configuration key to set
41 * @param mixed $value The value to store
43 * @return bool Operation success
45 public function set($cat, $k, $value);
48 * Removes the configured value from the stored cache
49 * and removes it from the database.
51 * @param string $cat The category of the configuration value
52 * @param string $k The configuration key to delete
56 public function delete($cat, $k);
59 * Checks, if the current adapter is connected to the backend
63 public function isConnected();