Umil.cache purge
From phpBB Development Wiki
umil::cache_purge –– Purges a cache using the Umil Library.
Contents |
Description
string umil::cache_purge ( mixed $type [, int $style_id ] )
Parameters
| Parameter | Required/Default | Usage |
|---|---|---|
| type | default '' | The type of Purge you wish to perform ('', 'auth', 'imageset', 'template', 'theme'). Blank purges the forum cache ($cache->purge()). |
| style_id | default 0 | Leave as 0 when submitting either 'imageset', 'template', or 'theme' to clear them all, or submit a specific id to clear only that one. |
Return Values
Returns result or umil_end data
Examples
Example #1
Purge the forum's cache folder (same as running $cache->purge())
$umil->cache_purge();
Example #2
Purging the Auth cache ($cache->destroy('_acl_options'); & $auth->acl_clear_prefetch();)
$umil->cache_purge('auth');
Example #3
Purging an Imageset Cache ('template' and 'theme' work the same)
$umil->cache_purge('imageset');
Example #4
Purging the imageset cache for style 1 ('template' and 'theme' work the same)
$umil->cache_purge('imageset', 1);
Example #5
Purging multiple caches with 1 call (in this case, the auth, imageset 1, template 2, and all the themes)
$umil->cache_purge(array(
'auth', // The auth
array('imageset', 1), // The imageset (1)
array('template', 2), // The template (2)
'theme', // The theme (all)
));
See Also

