* 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
- * @return mixed Stored value or false if it does not exist
+ * @param boolean $refresh
+ * If true the config is loaded from the db and not from the cache
+ * @return mixed Stored value or null if it does not exist
*/
- public static function get($family, $key, $instore = false) {
+ public static function get($family, $key, $refresh = false) {
global $a;
// Looking if the whole family isn't set
if(isset($a->config[$family])) {
if($a->config[$family] === '!<unset>!') {
- return false;
+ return null;
}
}
if(isset($a->config[$family][$key])) {
if($a->config[$family][$key] === '!<unset>!') {
- return false;
+ return null;
}
return $a->config[$family][$key];
}
elseif (function_exists("xcache_set"))
xcache_set($family."|".$key, '!<unset>!', 600);*/
}
- return false;
+ return null;
}
/**
* 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
- * @return mixed Stored value or false if it does not exist
+ * @param boolean $refresh
+ * If true the config is loaded from the db and not from the cache
+ * @return mixed Stored value or null if it does not exist
*/
- public static function get($uid,$family, $key, $instore = false) {
+ public static function get($uid, $family, $key, $refresh = false) {
global $a;
// Looking if the whole family isn't set
if(isset($a->config[$uid][$family])) {
if($a->config[$uid][$family] === '!<unset>!') {
- return false;
+ return null;
}
}
if(isset($a->config[$uid][$family][$key])) {
if($a->config[$uid][$family][$key] === '!<unset>!') {
- return false;
+ return null;
}
return $a->config[$uid][$family][$key];
}
elseif (function_exists("xcache_set"))
xcache_set($uid."|".$family."|".$key, '!<unset>!', 600);*/
}
- return false;
+ return null;
}
/**
* 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, $refresh);
+ if(is_null($v))
+ $v = false;
+
+ return $v;
}
/**
* 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, $refresh);
+ if(is_null($v))
+ $v = false;
+
+ return $v;
}
/**