function CACHE_cleanup_plugin($plugin) { global $TEMPLATE_OPTIONS; if (!empty($plugin)) { $plugin = str_replace(array('..', '/', '\\'), '', $plugin); $plugin = '__' . $plugin . '__'; } $path_cache = substr($TEMPLATE_OPTIONS['path_cache'], 0, -1); cache_clean_directories($path_cache, $plugin); }
function CACHE_remove_instance($iid) { global $TEMPLATE_OPTIONS; $iid = str_replace(array('..', '/', '\\', ':'), '', $iid); // COMMENT ORIGINAL LINE below out since not sure why changing dashes to under scores ... this affects articles and staticpages // When creating the cache instance file we use COM_sanitizeFilename which doesn't change dashes so // no need to change here when deleting cache file (since names will not match). // Dashes can be used in ids like with blocks, articles, and staticpages // Confusion may have happened since this is done for cache theme template files but not cache instances // $iid = str_replace('-','_',$iid); $path_cache = substr($TEMPLATE_OPTIONS['path_cache'], 0, -1); cache_clean_directories($path_cache, 'instance__' . $iid); }