]> git.mxchange.org Git - friendica.git/blobdiff - include/config.php
Degrade priority step by step
[friendica.git] / include / config.php
index d8c97744e48a19f56f8b7dacb6a58a7444fbc6ca..1c8b119bcc989ee8be13fa656198d09abc7a83fc 100644 (file)
@@ -1,11 +1,7 @@
 <?php
-
-require_once("include/PConfig.php");
-require_once("include/Config.php");
-
 /**
  * @file include/config.php
- * 
+ *
  *  @brief (Deprecated) Arbitrary configuration storage
  * Note:
  * Please do not store booleans - convert to 0/1 integer values
@@ -16,6 +12,9 @@ require_once("include/Config.php");
  * configurations need to be fixed as of 10/08/2011.
  */
 
+use Friendica\Core\Config;
+use Friendica\Core\PConfig;
+
 /**
  * @brief (Deprecated) Loads all configuration values of family into a cached storage.
  *
@@ -39,11 +38,13 @@ function load_config($family) {
  *  The category of the configuration value
  * @param string $key
  *  The configuration key to query
- * @param boolean $instore Determines if the key already exists in the DB
+ * @param boolean $refresh
+ *  If true the config is loaded from the db and not from the cache
  * @return mixed Stored value or false if it does not exist
  */
-function get_config($family, $key, $instore = false) {
-       return Config::get($family, $key, $instore);
+function get_config($family, $key, $refresh = false) {
+       $v = Config::get($family, $key, false, $refresh);
+       return $v;
 }
 
 /**
@@ -105,12 +106,13 @@ function load_pconfig($uid,$family) {
  *  The category of the configuration value
  * @param string $key
  *  The configuration key to query
- * @param boolean $instore
- * Determines if the key already exists in the DB
+ * @param boolean $refresh
+ *  If true the config is loaded from the db and not from the cache
  * @return mixed Stored value or false if it does not exist
  */
-function get_pconfig($uid,$family, $key, $instore = false) {
-       return PConfig::get($uid, $family, $key, $instore);
+function get_pconfig($uid, $family, $key, $refresh = false) {
+       $v = PConfig::get($uid, $family, $key, false, $refresh);
+       return $v;
 }
 
 /**