aboutsummaryrefslogtreecommitdiffstats
path: root/include/config.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-03-24 09:58:21 +0000
committerMario <mario@mariovavti.com>2024-03-24 09:58:21 +0000
commita0cfe22501dc9daa7dd8cff86803cf494a1f5ec3 (patch)
treee156db21df2251b8c67e61453c8f4af9f9460d2f /include/config.php
parentecdd9a4d6edd769a3e2c3b0604e4637d94fa1a51 (diff)
parent0dc959d9fe40bddce5e99b8162bb0e770fc28ed9 (diff)
downloadvolse-hubzilla-a0cfe22501dc9daa7dd8cff86803cf494a1f5ec3.tar.gz
volse-hubzilla-a0cfe22501dc9daa7dd8cff86803cf494a1f5ec3.tar.bz2
volse-hubzilla-a0cfe22501dc9daa7dd8cff86803cf494a1f5ec3.zip
Merge branch 'deprecate-include-config-in-core' into 'dev'
Deprecate *_config() functions in core. See merge request hubzilla/core!2114
Diffstat (limited to 'include/config.php')
-rw-r--r--include/config.php65
1 files changed, 65 insertions, 0 deletions
diff --git a/include/config.php b/include/config.php
index ec3547a82..674d5afe4 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);
}