<?php
class admin_cacheControl extends skymvc{

	public function __construct(){
		parent::__construct();
	}
	
	public function onDefault(){
		$type=strtolower(get('type'));
		if(in_array($type,array("all","compiled","cache","html","filecache"))){
			$fun="on".$type;
			$this->$fun();
		}
		$this->gomsg("缓存清理成功");
	}
	public function onAll(){
		$this->onHtml();
		$this->onCompiled();
		$this->oncache();
		$this->onfilecache();
	}
	
	public function onHtml(){
		//delfile(ROOT_PATH."temp/html/");
	}
	public function onCompiled(){
		delfile(ROOT_PATH."temp/compiled/");
	}
	public function oncache(){
		
		delfile(ROOT_PATH."temp/caches/");
		
	}
	
	public function onfilecache(){
		
		delfile(ROOT_PATH."temp/filecache/");
		 
	}
	
}
?>