config && pconfig: return NULL if config is unset
This commit is contained in:
@@ -64,10 +64,11 @@ class Config {
|
||||
* 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;
|
||||
|
||||
@@ -75,13 +76,13 @@ class Config {
|
||||
// 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];
|
||||
}
|
||||
@@ -136,7 +137,7 @@ class Config {
|
||||
elseif (function_exists("xcache_set"))
|
||||
xcache_set($family."|".$key, '!<unset>!', 600);*/
|
||||
}
|
||||
return false;
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user