cache_clear_all
- Versions
- 4.6 – 4.7
cache_clear_all($cid = NULL, $wildcard = false)- 5 – 6
cache_clear_all($cid = NULL,$table= NULL, $wildcard = FALSE)- 7
cache_clear_all($cid = NULL, $bin = NULL, $wildcard = FALSE)
Expire data from the cache.
Parameters
$cid If set, the cache ID to delete. Otherwise, all cache entries that can expire are deleted.
$wildcard If set to true, the $cid is treated as a substring to match rather than a complete ID.
Code
includes/bootstrap.inc, line 244
<?php
function cache_clear_all($cid = NULL, $wildcard = false) {
if (empty($cid)) {
db_query("DELETE FROM {cache} WHERE expire != %d AND expire < %d", CACHE_PERMANENT, time());
}
else {
if ($wildcard) {
db_query("DELETE FROM {cache} WHERE cid LIKE '%%%s%%'", $cid);
}
else {
db_query("DELETE FROM {cache} WHERE cid = '%s'", $cid);
}
}
}
?>Login or register to post comments 