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

Issue #3463804: Add DrupalApcCache::deleteKey()

parent 1850c649
No related branches found
No related tags found
1 merge request!29Issue #3463804: Add DrupalApcCache::deleteKey()
Pipeline #233970 passed
......@@ -272,6 +272,18 @@ public function set($cid, $data, $expire = CACHE_PERMANENT) {
}
}
/**
* Deletes a cache item identified by the given cache ID.
*
* @param string $cid
* The cache ID of the item to delete.
*/
protected function deleteKey($cid) {
if (apcu_enabled()) {
apcu_delete($this->keyName($cid));
}
}
/**
* Deletes all the cache IDs matching the given prefix.
*
......@@ -315,11 +327,11 @@ public function clear($cid = NULL, $wildcard = FALSE) {
}
elseif (is_array($cid)) {
foreach ($cid as $entry) {
apcu_delete($this->keyName($entry));
$this->deleteKey($entry);
}
}
else {
apcu_delete($this->keyName($cid));
$this->deleteKey($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