diff options
author | Mario <mario@mariovavti.com> | 2024-07-06 11:05:22 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2024-07-06 11:05:22 +0000 |
commit | 45275910e606a02b12393714ea3b0409da440d61 (patch) | |
tree | 10b2d173d58cb930f8df28fe75af73dd4974c08c /include/config.php | |
parent | 0c1d0f7498661fb34dcca6f3c6566e757af310a7 (diff) | |
parent | c04e781926a78e514cdf211fa24930a331149072 (diff) | |
download | volse-hubzilla-45275910e606a02b12393714ea3b0409da440d61.tar.gz volse-hubzilla-45275910e606a02b12393714ea3b0409da440d61.tar.bz2 volse-hubzilla-45275910e606a02b12393714ea3b0409da440d61.zip |
Merge branch '9.2RC'master
Diffstat (limited to 'include/config.php')
-rw-r--r-- | include/config.php | 69 |
1 files changed, 67 insertions, 2 deletions
diff --git a/include/config.php b/include/config.php index ec3547a82..4dd40eccf 100644 --- a/include/config.php +++ b/include/config.php @@ -31,18 +31,83 @@ use Zotlabs\Lib as Zlib; +/** + * Loads the hub's configuration from database to a cached storage. + * + * Retrieve a category ($family) of config variables from database to a cached + * storage in the global App::$config[$family]. + * + * @param string $family The category of the configuration value + * + * @return Nothing + * + * @deprecated + * This function is deprecated, use Zotlabs\Lib\Config::Load + * instead. + */ function load_config($family) { Zlib\Config::Load($family); } +/** + * Get a particular config variable given the category name ($family) + * and a key. + * + * Get a particular config variable from the given category ($family) and the + * $key from a cached storage in App::$config[$family]. If a key is found in the + * DB but does not exist in local config cache, pull it into the cache so we + * do not have to hit the DB again for this item. + * + * Returns false if not set. + * + * @param string $family The category of the configuration value + * @param string $key The configuration key to query + * @param string $default (optional) default false + * + * @return mixed|false Return value or false on error or if not set + * + * @deprecated + * This function is deprecated, use Zotlabs\Lib\Config::Get + * instead. + */ function get_config($family, $key, $default = false) { return Zlib\Config::Get($family,$key,$default); } +/** + * Sets a configuration value for the hub. + * + * Stores a config value ($value) in the category ($family) under the key ($key). + * + * @param string $family The category of the configuration value + * @param string $key The configuration key to set + * @param mixed $value The value to store in the configuration + * + * @return mixed|false Return the set value, or false if the database update failed + * + * @deprecated + * This function is deprecated, use Zotlabs\Lib\Config::Set + * instead. + */ function set_config($family, $key, $value) { return Zlib\Config::Set($family,$key,$value); } +/** + * Deletes the given key from the hub's configuration database. + * + * Removes the configured value from the stored cache in App::$config[$family] + * and removes it from the database. + * + * @param string $family The category of the configuration value + * @param string $key The configuration key to delete + * + * @return mixed + * + * @deprecated + * This function is deprecated, use Zotlabs\Lib\Config::Delete + * instead. + */ function del_config($family, $key) { return Zlib\Config::Delete($family,$key); } @@ -55,8 +120,8 @@ function get_pconfig($uid, $family, $key, $default = false) { return Zlib\PConfig::Get($uid,$family,$key,$default); } -function set_pconfig($uid, $family, $key, $value) { - return Zlib\PConfig::Set($uid,$family,$key,$value); +function set_pconfig($uid, $family, $key, $value, $updated = NULL) { + return Zlib\PConfig::Set($uid, $family, $key, $value, $updated); } function del_pconfig($uid, $family, $key, $updated = NULL) { |