|
@@ -9,6 +9,7 @@ use fast\Tree;
|
|
use think\Config;
|
|
use think\Config;
|
|
use think\Db;
|
|
use think\Db;
|
|
use think\Lang;
|
|
use think\Lang;
|
|
|
|
+use think\Cache;
|
|
|
|
|
|
/**
|
|
/**
|
|
* Ajax异步请求接口
|
|
* Ajax异步请求接口
|
|
@@ -339,4 +340,25 @@ class Ajax extends Backend
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 清空系统缓存
|
|
|
|
+ */
|
|
|
|
+ public function wipeCache()
|
|
|
|
+ {
|
|
|
|
+ $wipe_cache_type = ['TEMP_PATH', 'LOG_PATH', 'CACHE_PATH'];
|
|
|
|
+ foreach ($wipe_cache_type as $item) {
|
|
|
|
+ if ($item == 'LOG_PATH') {
|
|
|
|
+ $dirs = (array) glob(constant($item) . '*');
|
|
|
|
+ foreach ($dirs as $dir) {
|
|
|
|
+ array_map('unlink', (array) glob($dir . DIRECTORY_SEPARATOR . '*.*'));
|
|
|
|
+ }
|
|
|
|
+ array_map('rmdir', $dirs);
|
|
|
|
+ } else {
|
|
|
|
+ array_map('unlink', (array) glob(constant($item) . DIRECTORY_SEPARATOR . '*.*'));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ Cache::clear();
|
|
|
|
+ $this->success('清空系统缓存成功!');
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|