diff options
author | friendica <info@friendica.com> | 2013-06-25 18:15:17 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-06-25 18:15:17 -0700 |
commit | 57c7f725f67ac868b54d0dbff2d4fb0122af3954 (patch) | |
tree | e107cfdc48e8b49141a672559ca82d441adf6a1a /include/config.php | |
parent | a0a91fc9719c0eb665043417ea582727f24a2cde (diff) | |
download | volse-hubzilla-57c7f725f67ac868b54d0dbff2d4fb0122af3954.tar.gz volse-hubzilla-57c7f725f67ac868b54d0dbff2d4fb0122af3954.tar.bz2 volse-hubzilla-57c7f725f67ac868b54d0dbff2d4fb0122af3954.zip |
begin code to sync channel changes across all channel clones.
Diffstat (limited to 'include/config.php')
-rw-r--r-- | include/config.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/config.php b/include/config.php index 6a134deae..1f7a4dbd7 100644 --- a/include/config.php +++ b/include/config.php @@ -195,7 +195,18 @@ function set_pconfig($uid,$family,$key,$value) { if(! array_key_exists($family,$a->config[$uid])) $a->config[$uid][$family] = array(); + // keep a separate copy for all variables which were + // set in the life of this page. We need this to + // synchronise channel clones. + + if(! array_key_exists('transient',$a->config[$uid])) + $a->config[$uid]['transient'] = array(); + if(! array_key_exists($family,$a->config[$uid]['transient'])) + $a->config[$uid]['transient'][$family] = array(); + $a->config[$uid][$family][$key] = $value; + $a->config[$uid]['transient'][$family][$key] = $value; + $ret = q("INSERT INTO pconfig ( uid, cat, k, v ) VALUES ( %d, '%s', '%s', '%s' ) ", intval($uid), dbesc($family), @@ -214,7 +225,17 @@ function set_pconfig($uid,$family,$key,$value) { dbesc($key) ); + // keep a separate copy for all variables which were + // set in the life of this page. We need this to + // synchronise channel clones. + + if(! array_key_exists('transient',$a->config[$uid])) + $a->config[$uid]['transient'] = array(); + if(! array_key_exists($family,$a->config[$uid]['transient'])) + $a->config[$uid]['transient'][$family] = array(); + $a->config[$uid][$family][$key] = $value; + $a->config[$uid]['transient'][$family][$key] = $value; if($ret) return $value; |