<?php
/**
 * 计划任务清除缓存
 * @Copyright (C) 2017 汉潮 All rights reserved.
 * @License http://www.hanchao9999.com
 * @Author xiaoq <xiaoq@570035208.com>
 */
namespace Common\Vendor\Cron;
class ClearCache{
	/**
     * 清理全站缓存
     */
    public function index($config_info){
		$dir = new \Common\Vendor\Dir;
		$cache = new \Think\Cache;
		//更新全站缓存
		is_dir(CACHE_PATH) && $dir->delDir(CACHE_PATH);
		is_dir(DATA_PATH) && $dir->delDir(DATA_PATH);
		$cache->getInstance()->clear();
		is_dir(RUNTIME_PATH.'statics/') && $dir->del(RUNTIME_PATH.'statics/');		
		$runtime_file = RUNTIME_PATH .'common~runtime.php';
		is_file($runtime_file) && @unlink($runtime_file);
		//更新计划任务
		updatetask($config_info);
	}
}
?>