diff options
author | Christian Schneider | 2010-01-17 15:39:54 +0000 |
---|---|---|
committer | Christian Schneider | 2010-01-17 15:39:54 +0000 |
commit | 7fff1b51ac0379138f52cad6d520c80dccbffa68 (patch) | |
tree | e0cca2736c338c436f8407022579c27be69841c3 | |
parent | 1a186a1f35b7fb83cd482c9b0183ad985766afa5 (diff) | |
download | itools-7fff1b51ac0379138f52cad6d520c80dccbffa68.tar.gz itools-7fff1b51ac0379138f52cad6d520c80dccbffa68.tar.bz2 itools-7fff1b51ac0379138f52cad6d520c80dccbffa68.zip |
Reduce number of put calls to it_cache
-rw-r--r-- | it_dbi.class | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/it_dbi.class b/it_dbi.class index 0aedb07..918fc4c 100644 --- a/it_dbi.class +++ b/it_dbi.class @@ -221,7 +221,7 @@ function _connect($p = array()) $this->_fatal("_connect(): can't select database \"{$p['db']}\""); $state['link'] = $this->_link; - it_dbi::_state_put($dbid, $state); + it_dbi::_state_put($dbid, $state, false); # Store only locally as link is not shared anyway } } @@ -759,11 +759,12 @@ function _state_get($dbid) return $result; } -function _state_put($dbid, $state) +function _state_put($dbid, $state, $shared = true) { #var_dump("put", $dbid, $state); $GLOBALS['it_dbi']->_state[$dbid] = $state; - it_cache::put("dbi:$dbid", array('link' => null) + (array)$state); # link is not transferable + if ($shared) + it_cache::put("dbi:$dbid", array('link' => null) + (array)$state); # link is not transferable } function _state_purgeshared($dbid) |