Пример #1
0
 public function qclear()
 {
     $obj_dir = new \Common\ORG\Dir();
     is_dir(DATA_PATH . '_fields/') && $obj_dir->del(DATA_PATH . '_fields/');
     is_dir(CACHE_PATH) && $obj_dir->delDir(CACHE_PATH);
     is_dir(DATA_PATH) && $obj_dir->del(DATA_PATH);
     is_dir(TEMP_PATH) && $obj_dir->delDir(TEMP_PATH);
     is_dir(LOG_PATH) && $obj_dir->delDir(LOG_PATH);
     is_dir(PIN_DATA_PATH . '/static/') && $obj_dir->del(PIN_DATA_PATH . '/static/');
     if (is_file(RUNTIME_FILE)) {
         unlink(RUNTIME_FILE);
     }
     $this->ajaxReturn(1, L('clear_success'));
 }
Пример #2
0
 /**
  * 模板列表
  */
 public function index()
 {
     $config_file = APP_PATH . 'Home/Conf/config.php';
     $config = (include $config_file);
     if ($dirname = input('get.dirname', 'trim')) {
         //写入配置文件
         $config['DEFAULT_THEME'] = $dirname;
         file_put_contents($config_file, "<?php \nreturn " . var_export($config, true) . ";", LOCK_EX);
         $obj_dir = new \Common\ORG\Dir();
         is_dir(CACHE_PATH . 'Home/') && $obj_dir->delDir(CACHE_PATH . 'Home/');
         @unlink(RUNTIME_FILE);
     }
     $tpl_dir = APP_PATH . 'Home/View/';
     $opdir = dir($tpl_dir);
     $template_list = array();
     while (false !== ($entry = $opdir->read())) {
         if ($entry[0] == '.') {
             continue;
         }
         if (!is_file($tpl_dir . $entry . '/info.php')) {
             continue;
         }
         $info = (include_once $tpl_dir . $entry . '/info.php');
         $info['preview'] = basename(APP_PATH) . '/Home/View/' . $entry . '/preview.gif';
         $info['dirname'] = $entry;
         $template_list[$entry] = $info;
     }
     $this->assign('template_list', $template_list);
     //当前使用的模板
     $this->assign('def_tpl', $config['DEFAULT_THEME']);
     $this->display();
 }
Пример #3
0
 /**
  * 删除备份
  */
 public function del_backup()
 {
     if ((!isset($_GET['backup']) || empty($_GET['backup'])) && (!isset($_POST['backup']) || empty($_POST['backup']))) {
         $this->error(L('illegal_parameters'));
     }
     $dir = new \Common\ORG\Dir();
     $dir->delDir(PIN_DATA_PATH . $this->backup_path . $_GET['backup'] . '/');
     $this->success(L('operation_success'));
 }