4 * To change this license header, choose License Headers in Project Properties.
5 * To change this template file, choose Tools | Templates
6 * and open the template in the editor.
9 namespace Friendica\Core\Config;
15 interface IPConfigAdapter
18 * @brief Loads all configuration values of a user's config family into a cached storage.
20 * All configuration values of the given user are stored in global cache
21 * which is available under the global variable $a->config[$uid].
23 * @param string $uid The user_id
24 * @param string $cat The category of the configuration value
28 public function load($uid, $cat);
31 * @brief Get a particular user's config variable given the category name
32 * ($family) and a key.
34 * Get a particular user's config value from the given category ($family)
35 * and the $key from a cached storage in $a->config[$uid].
37 * @param string $uid The user_id
38 * @param string $cat The category of the configuration value
39 * @param string $k The configuration key to query
40 * @param mixed $default_value optional, The value to return if key is not set (default: null)
41 * @param boolean $refresh optional, If true the config is loaded from the db and not from the cache (default: false)
43 * @return mixed Stored value or null if it does not exist
45 public function get($uid, $cat, $k, $default_value = null, $refresh = false);
48 * @brief Sets a configuration value for a user
50 * Stores a config value ($value) in the category ($family) under the key ($key)
51 * for the user_id $uid.
53 * @note Please do not store booleans - convert to 0/1 integer values!
55 * @param string $uid The user_id
56 * @param string $cat The category of the configuration value
57 * @param string $k The configuration key to set
58 * @param string $value The value to store
60 * @return mixed Stored $value or false
62 public function set($uid, $cat, $k, $value);
65 * @brief Deletes the given key from the users's configuration.
67 * Removes the configured value from the stored cache in $a->config[$uid]
68 * and removes it from the database.
70 * @param string $uid The user_id
71 * @param string $cat The category of the configuration value
72 * @param string $k The configuration key to delete
76 public function delete($uid, $cat, $k);