/** * Clear the cache and reload the whole page */ public function clearCache() { Event::unbind('process-end'); // Clear the directoty cache foreach (glob(CACHE_DIR . '*') as $elt) { App::fs()->remove($elt); } // Clear the directory of the theme foreach (glob(Theme::getSelected()->getStaticDir() . '*') as $element) { if (basename($element) != 'userfiles') { App::fs()->remove($element); } } App::response()->redirectToAction('index'); }