3 * @file include/config.php
5 * @brief (Deprecated) Arbitrary configuration storage
7 * Please do not store booleans - convert to 0/1 integer values
8 * The get_?config() functions return boolean false for keys that are unset,
9 * and this could lead to subtle bugs.
11 * There are a few places in the code (such as the admin panel) where boolean
12 * configurations need to be fixed as of 10/08/2011.
15 use \Friendica\Core\Config;
16 use \Friendica\Core\PConfig;
19 * @brief (Deprecated) Loads all configuration values of family into a cached storage.
21 * Note: This function is deprecated. Use Config::load() instead.
23 * @param string $family
24 * The category of the configuration value
27 function load_config($family) {
28 return Config::load($family);
32 * @brief (Deprecated) Get a particular user's config variable given the category name
33 * ($family) and a key.
35 * Note: This function is deprecated. Use Config::get() instead.
37 * @param string $family
38 * The category of the configuration value
40 * The configuration key to query
41 * @param boolean $refresh
42 * If true the config is loaded from the db and not from the cache
43 * @return mixed Stored value or false if it does not exist
45 function get_config($family, $key, $refresh = false) {
46 $v = Config::get($family, $key, false, $refresh);
51 * @brief (Deprecated) Sets a configuration value for system config
53 * Note: This function is deprecated. Use Config::set() instead.
55 * @param string $family
56 * The category of the configuration value
58 * The configuration key to set
59 * @param string $value
61 * @return mixed Stored $value or false if the database update failed
63 function set_config($family,$key,$value) {
64 return Config::set($family, $key, $value);
68 * @brief (Deprecated) Deletes the given key from the system configuration.
70 * Note: This function is deprecated. Use Config::delete() instead.
72 * @param string $family
73 * The category of the configuration value
75 * The configuration key to delete
78 function del_config($family,$key) {
79 return Config::delete($family, $key);
83 * @brief (Deprecated) Loads all configuration values of a user's config family into a cached storage.
85 * Note: This function is deprecated. Use PConfig::load() instead.
89 * @param string $family
90 * The category of the configuration value
93 function load_pconfig($uid,$family) {
94 return PConfig::load($uid, $family);
98 * @brief (Deprecated) Get a particular user's config variable given the category name
99 * ($family) and a key.
101 * Note: This function is deprecated. Use PConfig::get() instead.
105 * @param string $family
106 * The category of the configuration value
108 * The configuration key to query
109 * @param boolean $refresh
110 * If true the config is loaded from the db and not from the cache
111 * @return mixed Stored value or false if it does not exist
113 function get_pconfig($uid, $family, $key, $refresh = false) {
114 $v = PConfig::get($uid, $family, $key, false, $refresh);
119 * @brief (Deprecated) Sets a configuration value for a user
121 * Note: This function is deprecated. Use PConfig::set() instead.
125 * @param string $family
126 * The category of the configuration value
128 * The configuration key to set
129 * @param string $value
131 * @return mixed Stored $value or false
133 function set_pconfig($uid,$family,$key,$value) {
134 return PConfig::set($uid, $family, $key, $value);
138 * @brief (Deprecated) Deletes the given key from the users's configuration.
140 * Note: This function is deprecated. Use PConfig::delete() instead.
142 * @param string $uid The user_id
143 * @param string $family
144 * The category of the configuration value
146 * The configuration key to delete
149 function del_pconfig($uid,$family,$key) {
150 return PConfig::delete($uid, $family, $key);