public function cacheAction() { $args = func_get_args(); $env = isset($args[0]) ? $args[0] : null; // get template path switch ($env) { case 'fe': $cleanDir = realpath(__DAT_DIR . '/cache'); break; case 'be': $cleanDir = realpath(__DAT_DIR . '/cache'); break; default: die("Error : Invalid input"); } if (is_dir($cleanDir)) { Hush_Util::dir_clean($cleanDir); echo "clean dir '{$cleanDir}' ok.\n"; } else { echo "clean dir '{$cleanDir}' failed.\n"; } }