// Merge -> revision 8952

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8957 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2011-10-03 09:14:01 +00:00
parent f1e265fad4
commit ef17d0b7da
44 changed files with 622 additions and 366 deletions
+5 -2
View File
@@ -94,6 +94,7 @@ class MCachedCore extends Cache
if ($this->isBlacklist($query))
return true;
$md5_query = md5($query);
$this->_setKeys();
if (isset($this->_keysCached[$md5_query]))
return true;
$key = $this->set($md5_query, $result);
@@ -101,6 +102,7 @@ class MCachedCore extends Cache
foreach($res[1] AS $table)
if(!isset($this->_tablesCached[$table][$key]))
$this->_tablesCached[$table][$key] = true;
$this->_writeKeys();
}
public function delete($key, $timeout = 0)
@@ -115,6 +117,7 @@ class MCachedCore extends Cache
{
if (!$this->_isConnected)
return false;
$this->_setKeys();
if (preg_match_all('/('._DB_PREFIX_.'[a-z_-]*)`?.*/i', $query, $res))
foreach ($res[1] AS $table)
if (isset($this->_tablesCached[$table]))
@@ -126,6 +129,7 @@ class MCachedCore extends Cache
}
unset($this->_tablesCached[$table]);
}
$this->_writeKeys();
}
protected function close()
@@ -144,9 +148,8 @@ class MCachedCore extends Cache
return false;
}
public function __destruct()
private function _writeKeys()
{
parent::__destruct();
if (!$this->_isConnected)
return false;
$this->_memcacheObj->set('keysCached', $this->_keysCached, 0, 0);