From b69fca14e76a2f5db0cd0924fe5e7056e94771b1 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 26 Feb 2013 15:49:37 -0800 Subject: initial doco --- include/config.php | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'include/config.php') 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] = "!!"; } -}} +} // 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] = '!!'; } 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] = "!!"; } -}} +} + -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] = '!!'; } 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; -}} +} -- cgit v1.2.3