复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64控制器 <?php namespace AdminController; use ThinkController; class ClearController extends Controller { public function clearcache(){ /*通过删除runtime 文件夹*/ $rtim=del_dir(APP_PATH.'Runtime'); if($rtim){ $this->success('清除成功'); echo '<script language="javascript">'; echo 'parent.location.reload();'; echo '</script>'; }else{ $this->error('清除失败'); } } } 公共函数 /*删除文件夹*/ function del_dir($dir) { $dh=opendir($dir); while ($file=readdir($dh)) { if($file!="." && $file!="..") { $fullpath=$dir."/".$file; if(!is_dir($fullpath)) { @unlink($fullpath); } else { del_dir($fullpath); } } } closedir($dh); if(rmdir($dir)) { return true; } else { return false; } } 视图 <a href="__MODULE__/Clear/clearcache" target="right">清除缓冲</a>
最后
以上就是诚心鸡翅最近收集整理的关于thinkphp3.2.3 清除缓存删除runtime文件夹的方法的全部内容,更多相关thinkphp3.2.3内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复