删除ThinkPhp的缓存文件

最近公司的项目是thinkphp做的,于是搞thinkphp,但是缓存实在太痛苦了,按照网上配置这里配置那里还是不行,干脆直接写个文件删除runtime下面的文件.
当然logs不用删,要存储一些日志的.

<?php
 	$dirPath	=	"./Runtime";
 	$fileArr	=	file_list($dirPath);
 	foreach($fileArr as $file)
 	{
 		if(strstr($file,"Logs")==false)
 		{
 			unlink($file);
 			echo $file.'<br />';
 		}
 	}
 
 	$fileList	=	array();
 	function file_list($path)
 	{
 		global $fileList;
 		if ($handle = opendir($path)) 
 		{
 			while (false !== ($file = readdir($handle))) 
 			{
 				if ($file != "." && $file != "..") 
 				{
 					if (is_dir($path."/".$file)) 
 					{
 						//echo $path."/".$file."<br>";
 						file_list($path."/".$file);
 					} 
 					else 
 					{
 						//echo $path."/".$file."<br>";
 						$fileList[]	=	$path."/".$file;
 					}
 				}
 			}
 		}
 		return $fileList;
 	}
 ?>

Related posts:

2 thoughts on “删除ThinkPhp的缓存文件”

Leave a Reply

Your email address will not be published.