/** * クリーンアップ */ public function cleanUp($action, $context) { $action = us($action); switch ($action) { case "get_empty_data": case "get_integer_data": case "get_string_data": case "get_array_data": case "get_boolean_data": case "get_float_data": case "get_object_data": case "set_duration": case "delete": case "delete_wildcard": case "delete_regex": case "touch": case "touch_wildcard": case "touch_regex": $cache_files = glob($this->cache_root . '/*'); if ($cache_files && is_array($cache_files)) { foreach ($cache_files as $cache) { $file = new Charcoal_File(s($cache)); $name = $file->getName(); $ext = $file->getExtension(); if ($file->exists() && $file->isFile() && in_array($ext, array("meta", "data"))) { $file->delete(); echo "removed cache file: [{$cache}]" . eol(); } } } break; default: break; } }