Link | cache_names |
Author | Jason Huck |
Category | Utility |
Version | 8.x |
License | Public Domain |
Posted | 21 Oct 2005 |
Updated | 13 May 2009 |
More by this author... |
Returns an array of all the current cache names.
// delete all caches that start with 'mysite_' iterate(cache_names, local('i')); #i->beginswith('mysite_') ? cache_delete( -name=#i); /iterate;
Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.
define_tag( 'names', -namespace='cache_', -opt='session', -priority='replace', -description='Returns all the currently stored cache names as an array.' ); local('out' = array); // caching system changed as of 8.5.6 if(!lasso_tagexists('cache_maintenance')); iterate(global('_Cache_Storage'), local('this')); #out->insert(#this->first->split('|')->get(1)); /iterate; else; define_tag( 'getname', -req='src', -copy, -opt='session' ); local('cachekeys') = array( '_local', '_global', '_' + server_name, '_' + (local_defined('session') ? session_id(#session) | 'session') ); local('name') = string; iterate(#cachekeys, local('i')); if(#src >> #i); #name = #src->removeleading('_cache_')&split(#i)->first; /if; /iterate; return(#name); /define_tag; iterate(globals->keys, local('i')); if( #i->beginswith('_cache_') && #i !>> 'preference' && #i !>> 'lastexpiration' ); // local('name') = #i->split('_')->get(3); local('name') = getname(#i); #out !>> #name ? #out->insert(#name); /if; /iterate; if(local_defined('session')); iterate(vars->keys, local('i')); if(#i->beginswith('_cache_')); // local('name') = #i->split('_')->get(3); local('name') = getname(#i); #out !>> #name ? #out->insert(#name, -session=#session); /if; /iterate; /if; /if; return(#out); /define_tag;
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft
Updated for 8.5.6.