diff options
author | friendica <info@friendica.com> | 2013-02-26 15:49:37 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-02-26 15:49:37 -0800 |
commit | b69fca14e76a2f5db0cd0924fe5e7056e94771b1 (patch) | |
tree | 4034a1f44cbb6115561c2506b36f318382591f8c /include/config.php | |
parent | 9430117204cdd55581bff52bda71f33db796aae9 (diff) | |
download | volse-hubzilla-b69fca14e76a2f5db0cd0924fe5e7056e94771b1.tar.gz volse-hubzilla-b69fca14e76a2f5db0cd0924fe5e7056e94771b1.tar.bz2 volse-hubzilla-b69fca14e76a2f5db0cd0924fe5e7056e94771b1.zip |
initial doco
Diffstat (limited to 'include/config.php')
-rw-r--r-- | include/config.php | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/include/config.php b/include/config.php index 6e1196af1..9eea446aa 100644 --- a/include/config.php +++ b/include/config.php @@ -15,7 +15,6 @@ // retrieve a "family" of config variables from database to cached storage -if(! function_exists('load_config')) { function load_config($family) { global $a; $r = q("SELECT * FROM `config` WHERE `cat` = '%s'", dbesc($family)); @@ -32,7 +31,7 @@ function load_config($family) { // Negative caching $a->config[$family] = "!<unset>!"; } -}} +} // get a particular config variable given the family name // and key. Returns false if not set. @@ -42,7 +41,7 @@ function load_config($family) { // local config cache, pull it into the cache so we don't have // to hit the DB again for this item. -if(! function_exists('get_config')) { + function get_config($family, $key, $instore = false) { global $a; @@ -76,13 +75,13 @@ function get_config($family, $key, $instore = false) { $a->config[$family][$key] = '!<unset>!'; } return false; -}} +} // Store a config value ($value) in the category ($family) // under the key ($key) // Return the value, or false if the database update failed -if(! function_exists('set_config')) { + function set_config($family,$key,$value) { global $a; // manage array value @@ -111,10 +110,10 @@ function set_config($family,$key,$value) { if($ret) return $value; return $ret; -}} +} + -if(! function_exists('load_pconfig')) { function load_pconfig($uid,$family) { global $a; $r = q("SELECT * FROM `pconfig` WHERE `cat` = '%s' AND `uid` = %d", @@ -130,11 +129,11 @@ function load_pconfig($uid,$family) { // Negative caching $a->config[$uid][$family] = "!<unset>!"; } -}} +} + -if(! function_exists('get_pconfig')) { function get_pconfig($uid,$family, $key, $instore = false) { global $a; @@ -170,9 +169,9 @@ function get_pconfig($uid,$family, $key, $instore = false) { $a->config[$uid][$family][$key] = '!<unset>!'; } return false; -}} +} + -if(! function_exists('del_config')) { function del_config($family,$key) { global $a; @@ -183,14 +182,14 @@ function del_config($family,$key) { dbesc($key) ); return $ret; -}} +} // Same as above functions except these are for personal config storage and take an // additional $uid argument. -if(! function_exists('set_pconfig')) { + function set_pconfig($uid,$family,$key,$value) { global $a; @@ -222,9 +221,9 @@ function set_pconfig($uid,$family,$key,$value) { if($ret) return $value; return $ret; -}} +} + -if(! function_exists('del_pconfig')) { function del_pconfig($uid,$family,$key) { global $a; @@ -236,4 +235,4 @@ function del_pconfig($uid,$family,$key) { dbesc($key) ); return $ret; -}} +} |