|
|
@ -42,6 +42,7 @@ class rcube_cache_shared
|
|
|
|
private $index;
|
|
|
|
private $index;
|
|
|
|
private $table;
|
|
|
|
private $table;
|
|
|
|
private $debug;
|
|
|
|
private $debug;
|
|
|
|
|
|
|
|
private $index_changed = false;
|
|
|
|
private $cache = array();
|
|
|
|
private $cache = array();
|
|
|
|
private $cache_changes = array();
|
|
|
|
private $cache_changes = array();
|
|
|
|
private $cache_sums = array();
|
|
|
|
private $cache_sums = array();
|
|
|
@ -115,7 +116,6 @@ class rcube_cache_shared
|
|
|
|
function set($key, $data)
|
|
|
|
function set($key, $data)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$this->cache[$key] = $data;
|
|
|
|
$this->cache[$key] = $data;
|
|
|
|
$this->cache_changed = true;
|
|
|
|
|
|
|
|
$this->cache_changes[$key] = true;
|
|
|
|
$this->cache_changes[$key] = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -164,7 +164,6 @@ class rcube_cache_shared
|
|
|
|
// Remove all keys
|
|
|
|
// Remove all keys
|
|
|
|
if ($key === null) {
|
|
|
|
if ($key === null) {
|
|
|
|
$this->cache = array();
|
|
|
|
$this->cache = array();
|
|
|
|
$this->cache_changed = false;
|
|
|
|
|
|
|
|
$this->cache_changes = array();
|
|
|
|
$this->cache_changes = array();
|
|
|
|
$this->cache_sums = array();
|
|
|
|
$this->cache_sums = array();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -222,10 +221,6 @@ class rcube_cache_shared
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function close()
|
|
|
|
function close()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!$this->cache_changed) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach ($this->cache as $key => $data) {
|
|
|
|
foreach ($this->cache as $key => $data) {
|
|
|
|
// The key has been used
|
|
|
|
// The key has been used
|
|
|
|
if ($this->cache_changes[$key]) {
|
|
|
|
if ($this->cache_changes[$key]) {
|
|
|
@ -239,7 +234,9 @@ class rcube_cache_shared
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$this->write_index();
|
|
|
|
if ($this->index_changed) {
|
|
|
|
|
|
|
|
$this->write_index();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -474,6 +471,10 @@ class rcube_cache_shared
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($result) {
|
|
|
|
|
|
|
|
$this->index_changed = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return $result;
|
|
|
|
return $result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -501,6 +502,10 @@ class rcube_cache_shared
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($result) {
|
|
|
|
|
|
|
|
$this->index_changed = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($index) {
|
|
|
|
if ($index) {
|
|
|
|
if (($idx = array_search($key, $this->index)) !== false) {
|
|
|
|
if (($idx = array_search($key, $this->index)) !== false) {
|
|
|
|
unset($this->index[$idx]);
|
|
|
|
unset($this->index[$idx]);
|
|
|
|