<?php
$C_126cmsadmin_tname = 'center_config';

include(dirname(__FILE__)."/global.php");



function deleteDir($Directory){

	is_dir($Directory) or die("目录：  $Directory 不存在");

	$handle = opendir($Directory);

	while(($file_name = readdir($handle))!==false){
	
		$file_path = $Directory.DIRECTORY_SEPARATOR.$file_name;
		
		if($file_name!="." && $file_name!=".."){
			
			if(is_dir($file_path)){
				deleteDir($file_path);
			}else{
				if(unlink($file_path)){
					echo '...';
					//echo "删除文件: $file_path 成功！";
				}else{
					return false;
					exit;
					//die("删除文件： $file_path 失败！");
				}
			}
			
		}
	
	}



	closedir($handle);

	/*
	if(rmdir($Directory)){
		echo "删除目录： $Directory 成功！";
	}
	*/
	
	return true;
	
}

$Directory = '../../cache';

if ( deleteDir($Directory) ){
	$showmsg = "成功清除缓存！";
	$formurl = "config.php";
}else{
	$showmsg = "清除缓存失败！";
	$formurl = "config.php";
}

include('showmsg.php');
exit;


?>