zoukankan      html  css  js  c++  java
  • ThinkPHP5 清除runtime缓存文件

     

    1. /**  
    2.  * 清除模版缓存 不删除cache目录  
    3.  */  
    4. public function clear_sys_cache() {  
    5. Cache::clear();  
    6. $this->success( '清除成功', 'index/index' );  
    7. }  
    8. /**  
    9.  * 清除模版缓存 不删除 temp目录  
    10.  */  
    11. public function clear_temp_ahce() {  
    12. array_map( 'unlink', glob( TEMP_PATH.DS.'.php' ) );  
    13. $this->success( '清除成功', 'index/index' );  
    14. }  
    15. /**  
    16.  * 清除日志缓存 不删出log目录  
    17.  */  
    18. public function clear_log_chache() {  
    19. $path = glob( LOG_PATH.'/' );  
    20. foreach ($path as $item) {  
    21. array_map( 'unlink', glob( $item.DS.'.' ) );  
    22. rmdir( $item );  
    23. }  
    24. $this->success( '清除成功', 'index/index' );  
    25. }  
    26. /**  
    27.  * 清除glob  
    28.  */  
    29. function clert_temp_cache()  
    30. {  
    31.     array_map('unlink', glob(TEMP_PATH . '/*.php'));  
    32.     rmdir(TEMP_PATH);  
     
     
    标签: tp5
  • 相关阅读:
    python实现双向链表
    django contenttypes
    tensorflow学习笔记一
    vue指令和事件绑定
    es6简单介绍
    mysql主从复制
    mysql事务
    winform 使用 ReportViewer做报表
    设置控件获取焦点
    修改安卓串口蓝牙app问题记录
  • 原文地址:https://www.cnblogs.com/my2018/p/10208143.html
Copyright © 2011-2022 走看看