ThinkPHP5 清除runtime缓存文件
代码如下
/**
* 清除模版缓存 不删除cache目录
*/
public function clear_sys_cache() {
Cache::clear();
$this->success( "清除成功", "index/index" );
}
/**
* 清除模版缓存 不删除 temp目录
*/
public function clear_temp_ahce() {
array_map( "unlink", glob( TEMP_PATH.DS.".php" ) );
$this->success( "清除成功", "index/index" );
}
/**
* 清除日志缓存 不删出log目录
*/
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" );
}
/**
* 清除glob
*/
function clert_temp_cache()
{
array_map("unlink", glob(TEMP_PATH . "/*.php"));
rmdir(TEMP_PATH);
}声明:该文观点仅代表作者本人,入门客AI创业平台信息发布平台仅提供信息存储空间服务,如有疑问请联系rumenke@qq.com。
- 上一篇: PHP实现二维数组转字符串
- 下一篇: tp3.2 C方法详解
