<?php
require_once '../include/adminfunction.php';
checkadmin();
ini_set('max_execution_time',0);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>清理缓存中...缓存文件很多的时候需要多等待一会儿...</title>
</head>
<body>
<?php 
$fileNum=0;
print str_pad("",100000); 
flush();
function deldirdd($dir)
{
	global $fileNum;
	$dh=opendir($dir);
	while ($file=readdir($dh))
	{
		if($file!="." && $file!="..")
		{
			$fullpath=$dir."/".$file;
			if(!is_dir($fullpath))
			{
				unlink($fullpath);
				if(($fileNum % 3000)==0)
				{
					print str_pad("",100000); 
					echo("已删除".$fileNum."</BR>");
					flush();
				}
				$fileNum=$fileNum+1;
			}
			else
			{
				deldirdd($fullpath);
			}
		}
	}
	closedir($dh);
}
deldirdd("../Apicache");
echo "已经成功删除缓存文件!共删除文件" . $fileNum ."个"
?>
</body>
</html>


