Skip to content

Instantly share code, notes, and snippets.

@EHLOVader
Created August 23, 2012 03:15
Show Gist options
  • Save EHLOVader/3431793 to your computer and use it in GitHub Desktop.
Save EHLOVader/3431793 to your computer and use it in GitHub Desktop.
Lemonstand Clear cache folder
<?php
if(!Phpr::$security->getUser())
{
Phpr::$response->redirect(root_url('/'));
}else
{
$cache = Phpr::$config->get('CACHING',array());
if(isset($cache['PARAMS']) && isset($cache['PARAMS']['CACHE_DIR']))
{
$dir = $cache['PARAMS']['CACHE_DIR'];
foreach(glob($dir.'/*') as $v){
unlink($v);
echo "REMOVED: " . $v . "</br>";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment