// 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:
+5
-2
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user