From 57c7f725f67ac868b54d0dbff2d4fb0122af3954 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 25 Jun 2013 18:15:17 -0700 Subject: begin code to sync channel changes across all channel clones. --- include/config.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'include/config.php') 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; -- cgit v1.2.3