Skip to content
Snippets Groups Projects
Verified Commit c32f471d authored by Alberto Paderno's avatar Alberto Paderno
Browse files

Issue #3463202: Replace DrupalApcCache::deletePrefix() and...

Issue #3463202: Replace DrupalApcCache::deletePrefix() and DrupalApcCache::flush() with DrupalApcCache::deleteKeys()
parent 105841e9
No related branches found
No related tags found
1 merge request!26Issue #3463202: Replace DrupalApcCache::deletePrefix() and DrupalApcCache::flush() with DrupalApcCache::deleteKeys()
Pipeline #231544 passed
......@@ -259,7 +259,7 @@ public function set($cid, $data, $expire = CACHE_PERMANENT) {
* @param string $prefix
* The prefix for the cache IDs to delete.
*/
protected function deletePrefix($prefix) {
protected function deleteKeys($prefix = '') {
if (class_exists('APCUIterator')) {
$escaped_key = preg_quote($this->keyName($prefix), '/');
$iterator = new APCUIterator("/^$escaped_key/", APC_ITER_KEY);
......@@ -267,13 +267,6 @@ protected function deletePrefix($prefix) {
}
}
/**
* Flushes all cache items in a bin.
*/
protected function flush() {
$this->deletePrefix('');
}
/**
* {@inheritdoc}
*/
......@@ -290,15 +283,15 @@ public function clear($cid = NULL, $wildcard = FALSE) {
$GLOBALS['_apc_statistics'][] = array('clear', $this->bin, $cid, (int) $wildcard);
if (empty($cid)) {
$this->flush();
$this->deleteKeys();
}
else {
if ($wildcard) {
if ($cid == '*') {
$this->flush();
$this->deleteKeys();
}
else {
$this->deletePrefix($cid);
$this->deleteKeys($cid);
}
}
elseif (is_array($cid)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment