aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-08-19 07:15:41 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-08-19 07:15:41 -0700
commitadad23a0ea647dfc942751a6548bbee7901abb10 (patch)
treece49b97a7e72025ce6c60cea2167a0b73c5a4faf /boot.php
parentb16be9e76a9288f0b6803dbaa989a7bdee70d49d (diff)
downloadvolse-hubzilla-adad23a0ea647dfc942751a6548bbee7901abb10.tar.gz
volse-hubzilla-adad23a0ea647dfc942751a6548bbee7901abb10.tar.bz2
volse-hubzilla-adad23a0ea647dfc942751a6548bbee7901abb10.zip
cached config glitch
Diffstat (limited to 'boot.php')
-rw-r--r--boot.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/boot.php b/boot.php
index 17eccd138..c3d859aef 100644
--- a/boot.php
+++ b/boot.php
@@ -579,11 +579,12 @@ function load_config($family) {
if(! function_exists('get_config')) {
-function get_config($family,$key) {
+function get_config($family, $key, $instore = false) {
global $a;
- if(isset($a->config[$family][$key]))
- return $a->config[$family][$key];
-
+ if(! $instore) {
+ if(isset($a->config[$family][$key]))
+ return $a->config[$family][$key];
+ }
$ret = q("SELECT `v` FROM `config` WHERE `cat` = '%s' AND `k` = '%s' LIMIT 1",
dbesc($family),
dbesc($key)
@@ -601,7 +602,7 @@ function set_config($family,$key,$value) {
global $a;
$a->config[$family][$key] = $value;
- if(get_config($family,$key) === false) {
+ if(get_config($family,$key,true) === false) {
$ret = q("INSERT INTO `config` ( `cat`, `k`, `v` ) VALUES ( '%s', '%s', '%s' ) ",
dbesc($family),
dbesc($key),
@@ -611,7 +612,7 @@ function set_config($family,$key,$value) {
return $value;
return $ret;
}
- $ret = q("SUPDATE `config` SET `v` = '%s' WHERE `cat` = '%s' AND `k` = '%s' LIMIT 1",
+ $ret = q("UPDATE `config` SET `v` = '%s' WHERE `cat` = '%s' AND `k` = '%s' LIMIT 1",
dbesc($value),
dbesc($family),
dbesc($key)