袁来如此的工作笔记
袁来如此的工作笔记
竹杖芒鞋轻胜马,谁怕? 一蓑烟雨任平生。

ThinkPHP5清除runtime缓存文件

浏览量:249

what:

why:

how:
  
public function clear_sys_cache() {  
Cache::clear();  
$this->success( \清除成功\, \index/index\ );  
}  
  
public function clear_temp_ahce() {  
array_map( \unlink\, glob( TEMP_PATH.DS.\.php\ ) );  
$this->success( \清除成功\, \index/index\ );  
}  
  
public function clear_log_chache() {  
$path = glob( LOG_PATH.\/\ );  
foreach ($path as $item) {  
array_map( \unlink\, glob( $item.DS.\.\ ) );  
rmdir( $item );  
}  
$this->success( \清除成功\, \index/index\ );  
}  
  
function clert_temp_cache()  
{  
    array_map(\unlink\, glob(TEMP_PATH . \.php\));  
    rmdir(TEMP_PATH);  
}

打赏