示例#1
0
 /**
  * 清除缓存
  */
 public function cleanAllCache()
 {
     error_reporting(E_ALL);
     ini_set('display_errors', 1);
     $rv = array('status' => -1);
     $BasePath = dirname(dirname(dirname(__FILE__)));
     $BasePath = $BasePath . "/Runtime/Temp";
     $rv['status'] = WSTDelDir($BasePath);
     $this->ajaxReturn($rv);
 }
示例#2
0
/**
 * 循环删除指定目录下的文件及文件夹
 * @param string $dirpath 文件夹路径
 */
function WSTDelDir($dirpath)
{
    $dh = opendir($dirpath);
    while (($file = readdir($dh)) !== false) {
        if ($file != "." && $file != "..") {
            $fullpath = $dirpath . "/" . $file;
            if (!is_dir($fullpath)) {
                unlink($fullpath);
            } else {
                WSTDelDir($fullpath);
                rmdir($fullpath);
            }
        }
    }
    closedir($dh);
    $isEmpty = 1;
    $dh = opendir($dirpath);
    while (($file = readdir($dh)) !== false) {
        if ($file != "." && $file != "..") {
            $isEmpty = 0;
            break;
        }
    }
    return $isEmpty;
}
示例#3
0
 /**
  * 是否新窗口打开
  */
 public function editiIsOpen()
 {
     $rd = array('status' => -1);
     if (I('id', 0) == 0) {
         return $rd;
     }
     $m = M('navs');
     $m->isOpen = I('isOpen') == 1 ? 1 : 0;
     $rs = $m->where("id = " . I('id', 0))->save();
     if (false !== $rs) {
         $rd['status'] = 1;
         WSTDelDir(C('WST_RUNTIME_PATH') . "/Data/navigation");
     }
     return $rd;
 }
 /**
  * 清除缓存
  */
 public function cleanAllCache()
 {
     $this->isAjaxLogin();
     $rv = array('status' => -1);
     //C('WST_RUNTIME_PATH',dirname(dirname(dirname(__File__)))."\Runtime");
     $rv['status'] = WSTDelDir(C('WST_RUNTIME_PATH'));
     $this->ajaxReturn($rv);
 }
示例#5
0
 /**
  * 清除缓存
  */
 public function cleanAllCache()
 {
     $rs = $this->isLogin();
     $rv = array('status' => -1);
     $rv['status'] = WSTDelDir(C('WST_RUNTIME_PATH'));
     $this->ajaxReturn($rv);
 }