phpBB

Development Wiki

Difference between revisions of "Umil.cache purge"

From phpBB Development Wiki

m (Example #1)
(Example #2)
Line 30: Line 30:
 
===Example #2===
 
===Example #2===
 
Purging the Auth cache ($cache->destroy('_acl_options'); & $auth->acl_clear_prefetch();)
 
Purging the Auth cache ($cache->destroy('_acl_options'); & $auth->acl_clear_prefetch();)
<php>$umil->purge_cache('auth');</php>
+
<php>$umil->cache_purge('auth');</php>
  
 
===Example #3===
 
===Example #3===

Revision as of 00:11, 5 July 2009

umil::cache_purge –– Purges a cache using the Umil Library.

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

This article is a stub. You can help in improving Olympus Documentation by expanding it.


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->purge_cache('imageset');

Example #4

Purging the imageset cache for style 1 ('template' and 'theme' work the same)

$umil->purge_cache('imageset'1);

Example #5

Purging multiple caches with 1 call (in this case, the cache folder, the auth, imageset 1, template 2, and all the themes)

$umil->purge_cache(array(
    
''// The cache folder
    
'auth'// The auth
    
array('imageset'1), // The imageset (1)
    
array('template'2), // The template (2)
    
'theme'// The theme (all)
));

See Also