Created
September 24, 2015 12:56
-
-
Save znerol/261fed072cc24222445e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_expire_cache(). | |
* | |
* Expire cache support for the builtin cache handler. | |
*/ | |
function authcache_builtin_expire_v2_expire_cache($urls, $wildcards, $object_type, $object) { | |
$cids = array(); | |
$wildcard_cids = array(); | |
$authcache_urls = array(); | |
foreach ($urls as $path => $url) { | |
list ($path, $options) = $url; | |
$options['absolute'] = FALSE; | |
$authcache_urls[$path] = url($path, $options); | |
} | |
foreach (authcache_enum_keys() as $key) { | |
foreach ($authcache_urls as $path => $url) { | |
$cid = $key . $url; | |
if (empty($wildcards[$path])) { | |
$cids[] = $cid; | |
} | |
else { | |
$wildcard_cids[] = $cid; | |
} | |
} | |
} | |
if (!empty($cids)) { | |
cache_clear_all($cids, 'cache_page'); | |
} | |
foreach ($wildcard_cids as $cid) { | |
cache_clear_all($cid, 'cache_page', TRUE); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment