diff options
author | friendica <info@friendica.com> | 2012-05-29 16:50:42 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-05-29 16:50:42 -0700 |
commit | 21d79e787ef6a1fd183a4f439c2488110841b530 (patch) | |
tree | 37af0898bb3ef5f39384d98aeae409a476b41aed /include/config.php | |
parent | 419cf91aae555f6e42767765f476b1f1cc85e5df (diff) | |
parent | 43c185ce04051caa0ae7543d635fa0b015befc58 (diff) | |
download | volse-hubzilla-21d79e787ef6a1fd183a4f439c2488110841b530.tar.gz volse-hubzilla-21d79e787ef6a1fd183a4f439c2488110841b530.tar.bz2 volse-hubzilla-21d79e787ef6a1fd183a4f439c2488110841b530.zip |
Merge https://github.com/friendica/friendica into pull
Conflicts:
mod/search.php
Diffstat (limited to 'include/config.php')
-rw-r--r-- | include/config.php | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/include/config.php b/include/config.php index 12fc9cafc..df1070c13 100644 --- a/include/config.php +++ b/include/config.php @@ -6,7 +6,7 @@ * Note: * Please do not store booleans - convert to 0/1 integer values * The get_?config() functions return boolean false for keys that are unset, - * and this could lead to subtle bugs. + * and this could lead to subtle bugs. * * There are a few places in the code (such as the admin panel) where boolean * configurations need to be fixed as of 10/08/2011. @@ -30,6 +30,9 @@ function load_config($family) { $a->config[$family][$k] = $rr['v']; } } + } else if ($rr['cat'] != 'config') { + // Negative caching + $a->config[$family] = "!<unset>!"; } }} @@ -47,6 +50,13 @@ function get_config($family, $key, $instore = false) { global $a; if(! $instore) { + // Looking if the whole family isn't set + if(isset($a->config[$family])) { + if($a->config[$family] === '!<unset>!') { + return false; + } + } + if(isset($a->config[$family][$key])) { if($a->config[$family][$key] === '!<unset>!') { return false; @@ -87,11 +97,11 @@ function set_config($family,$key,$value) { dbesc($key), dbesc($dbvalue) ); - if($ret) + if($ret) return $value; return $ret; } - + $ret = q("UPDATE `config` SET `v` = '%s' WHERE `cat` = '%s' AND `k` = '%s' LIMIT 1", dbesc($dbvalue), dbesc($family), @@ -118,6 +128,9 @@ function load_pconfig($uid,$family) { $k = $rr['k']; $a->config[$uid][$family][$k] = $rr['v']; } + } else if ($rr['cat'] != 'config') { + // Negative caching + $a->config[$uid][$family] = "!<unset>!"; } }} @@ -129,6 +142,13 @@ function get_pconfig($uid,$family, $key, $instore = false) { global $a; if(! $instore) { + // Looking if the whole family isn't set + if(isset($a->config[$uid][$family])) { + if($a->config[$uid][$family] === '!<unset>!') { + return false; + } + } + if(isset($a->config[$uid][$family][$key])) { if($a->config[$uid][$family][$key] === '!<unset>!') { return false; |