/**
  *
  */
 public function clear()
 {
     $caches = array("HTMLCache" => array("name" => "网站HTML缓存文件", "path" => RUNTIME_PATH . "HTML", "size" => File::realSize(RUNTIME_PATH . "HTML")), "HomeCache" => array("name" => "网站缓存文件", "path" => RUNTIME_PATH . "Cache", "size" => File::realSize(RUNTIME_PATH . "Cache")), "HomeData" => array("name" => "网站数据库字段缓存文件", "path" => RUNTIME_PATH . "Data", "size" => File::realSize(RUNTIME_PATH . "Data")), "AdminLog" => array("name" => "网站日志文件", "path" => LOG_PATH, "size" => File::realSize(LOG_PATH)), "AdminTemp" => array("name" => "网站临时文件", "path" => RUNTIME_PATH . "Temp", "size" => File::realSize(RUNTIME_PATH . "Temp")), "Homeruntime" => array("name" => "网站~runtime.php缓存文件", "path" => RUNTIME_PATH . "common~runtime.php", "size" => File::realSize(RUNTIME_PATH . "common~runtime.php")));
     // p($_POST['cache']);die;
     if (IS_POST) {
         $paths = $_POST['cache'];
         foreach ($paths as $path) {
             if (isset($caches[$path])) {
                 $res = File::delAll($caches[$path]['path'], true);
             }
         }
         $SystemEvent = new SystemEvent();
         $SystemEvent->clearCacheAll();
         $this->success("清除成功");
     } else {
         $this->assign("caches", $caches);
         $this->display();
     }
 }
 public function logClearHandle()
 {
     $res = File::delAll(LOG_PATH, true);
     $this->success("清除成功");
 }
 /**
  * 清空日志
  * @return bool
  */
 public function clearLog()
 {
     return File::delAll(LOG_PATH, true);
 }
 /**
  * 清空缓存
  * @param $cache_path
  * @return bool
  */
 public function clearCache($cache_path)
 {
     return File::delAll($cache_path, true);
 }
 /**
  * @param string $theme_name
  */
 public function themeDelHandle($theme_name = '')
 {
     if (get_kv('home_theme') == $theme_name) {
         $this->error('正在使用的主题不可以删除');
     }
     $tpl_view_path = WEB_ROOT . 'Application/Home/View/' . $theme_name . '/';
     $tpl_static_path = WEB_ROOT . 'Public/' . $theme_name . '/';
     File::delAll($tpl_view_path, true);
     File::delAll($tpl_static_path, true);
     $this->success('删除成功');
 }
 /**
  *
  */
 public function step5()
 {
     File::delAll(RUNTIME_PATH);
     File::delAll(LOG_PATH);
     File::delAll(WEB_CACHE_PATH);
     File::delAll(WEB_ROOT . 'Data/Cache');
     File::delAll(WEB_ROOT . 'Data/Temp');
     //A('Install/Test')->init($key = 'zts');
     $Access = new AccessEvent();
     $Access->initAdmin();
     $Access->initWeixin();
     // File::delAll(WEB_ROOT . 'Data/Install');
     if (File::writeFile(WEB_ROOT . 'Data/Install/install.lock', 'installed', 'w+')) {
         C('URL_MODEL', 3);
         $this->success('GreenCMS安装成功,5秒钟返回首页', U('Home/Index/index'), 5);
     }
 }
 /**
  *
  */
 public function step5()
 {
     File::delAll(RUNTIME_PATH);
     File::delAll(LOG_PATH);
     File::delAll(WEB_CACHE_PATH);
     File::delAll(WEB_ROOT . 'Data/Cache');
     File::delAll(WEB_ROOT . 'Data/Temp');
     //        $dirs = array();
     //
     //        array_push($dirs, WEB_ROOT . 'Extend');
     //        array_push($dirs, WEB_ROOT . 'Public');
     //        array_push($dirs, WEB_ROOT . 'Upload');
     //        array_push($dirs, WEB_ROOT . 'Data/Cache');
     //        array_push($dirs, WEB_ROOT . 'Data/Temp');
     //        array_push($dirs, LOG_PATH);
     //        array_push($dirs, RUNTIME_PATH);
     //        array_push($dirs, WEB_CACHE_PATH);
     //        array_push($dirs, DB_Backup_PATH);
     //        array_push($dirs, System_Backup_PATH);
     //        array_push($dirs, Upgrade_PATH);
     //build_dir_secure($dirs);
     //A('Install/Test')->init($key = 'zts');
     // $Access = new AccessEvent();
     //   $Access->initAdmin();
     //  $Access->initWeixin();
     // File::delAll(WEB_ROOT . 'Install/Data');
     if (File::writeFile(WEB_ROOT . 'Data/Install.lock', 'installed', 'w+')) {
         C('URL_MODEL', 3);
         $this->success('GreenCMS安装成功,5秒钟返回首页', get_opinion("site_url"), 5);
     }
 }
 /**
  * @param string $theme_name
  */
 public function themeDelHandle($theme_name = '')
 {
     if ($this->themeStatus($theme_name) == 'enabled') {
         $this->error('请先禁用主题');
     }
     $tpl_view_path = WEB_ROOT . 'Application/Home/View/' . $theme_name . '/';
     $tpl_static_path = WEB_ROOT . 'Public/' . $theme_name . '/';
     File::delAll($tpl_view_path, true);
     File::delAll($tpl_static_path, true);
     $this->success('删除成功');
 }