move config to its own class (with legacy support)
This commit is contained in:
parent
17f362f4f6
commit
7e8ea1cb87
3 changed files with 253 additions and 164 deletions
|
|
@ -7,7 +7,11 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* @brief Management of user configuration
|
||||
* @brief Management of user configuration storage
|
||||
* Note:
|
||||
* Please do not store booleans - convert to 0/1 integer values
|
||||
* The PConfig::get() functions return boolean false for keys that are unset,
|
||||
* and this could lead to subtle bugs.
|
||||
*/
|
||||
class PConfig {
|
||||
|
||||
|
|
@ -155,7 +159,7 @@ class PConfig {
|
|||
// manage array value
|
||||
$dbvalue = (is_array($value)?serialize($value):$value);
|
||||
|
||||
if(get_pconfig($uid,$family,$key,true) === false) {
|
||||
if(self::get($uid,$family,$key,true) === false) {
|
||||
$a->config[$uid][$family][$key] = $value;
|
||||
$ret = q("INSERT INTO `pconfig` ( `uid`, `cat`, `k`, `v` ) VALUES ( %d, '%s', '%s', '%s' ) ",
|
||||
intval($uid),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue