delDir() public method

+---------------------------------------------------------- 删除目录(包括下面的文件) +---------------------------------------------------------- +---------------------------------------------------------- +----------------------------------------------------------
public delDir ( $directory, $subdir = true )
Beispiel #1
0
 public function cache()
 {
     if (isset($_GET['type'])) {
         $Dir = new \Dir();
         $cache = D('Common/Cache');
         $type = I('get.type');
         switch ($type) {
             case "template":
                 //删除缓存目录下的文件
                 $Dir->del(RUNTIME_PATH);
                 $Dir->delDir(RUNTIME_PATH . "Cache/");
                 $Dir->delDir(RUNTIME_PATH . "Temp/");
                 //更新开启其他方式的缓存
                 \Think\Cache::getInstance()->clear();
                 $this->success("模板缓存清理成功!", U('Index/cache'));
                 break;
             case "logs":
                 $Dir->delDir(RUNTIME_PATH . "Logs/");
                 $this->success("站点日志清理成功!", U('Index/cache'));
                 break;
             default:
                 $this->error("请选择清楚缓存类型!");
                 break;
         }
     } else {
         $this->display();
     }
 }
Beispiel #2
0
 public function qclear()
 {
     $obj_dir = new 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/');
     @unlink(RUNTIME_FILE);
     $this->ajaxReturn(1, L('clear_success'));
 }
Beispiel #3
0
 public function index()
 {
     $config_file = CONF_PATH . 'index/config.php';
     $config = (include $config_file);
     if ($dirname = $this->_get('dirname', 'trim')) {
         $config['DEFAULT_THEME'] = $dirname;
         file_put_contents($config_file, "<?php \nreturn " . var_export($config, true) . ";", LOCK_EX);
         $obj_dir = new Dir();
         is_dir(CACHE_PATH . 'index/') && $obj_dir->delDir(CACHE_PATH . 'index/');
         @unlink(RUNTIME_FILE);
     }
     $tpl_dir = TMPL_PATH . 'index/';
     $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'] = TMPL_PATH . 'index/' . $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();
 }
Beispiel #4
0
function clear_cache()
{
    Dir::delDir(getcwd() . "/admin/Runtime/Cache/");
    Dir::delDir(getcwd() . "/admin/Runtime/Data/");
    Dir::delDir(getcwd() . "/admin/Runtime/Temp/");
    @unlink(getcwd() . "/admin/Runtime/~app.php");
    @unlink(getcwd() . "/admin/Runtime/~runtime.php");
    Dir::delDir(getcwd() . "/app/Runtime/Cache/");
    Dir::delDir(getcwd() . "/app/Runtime/Data/");
    Dir::delDir(getcwd() . "/app/Runtime/Temp/");
    Dir::delDir(getcwd() . "/app/Runtime/caches/");
    Dir::delDir(getcwd() . "/app/Runtime/compiled/");
    Dir::delDir(getcwd() . "/app/Runtime/" . HTML_DIR . '/');
    @unlink(getcwd() . "/app/Runtime/~app.php");
    @unlink(getcwd() . "/app/Runtime/~runtime.php");
    @unlink(getcwd() . "/app/Runtime/js_lang.js");
    Dir::delDir(getcwd() . "/install/Runtime/Cache/");
    Dir::delDir(getcwd() . "/install/Runtime/Data/");
    Dir::delDir(getcwd() . "/install/Runtime/Temp/");
    @unlink(getcwd() . "/install/Runtime/~app.php");
    @unlink(getcwd() . "/install/Runtime/~runtime.php");
    Dir::delDir(getcwd() . "/mobile/Runtime/Cache/");
    Dir::delDir(getcwd() . "/mobile/Runtime/Data/");
    Dir::delDir(getcwd() . "/mobile/Runtime/Temp/");
    @unlink(getcwd() . "/mobile/Runtime/~app.php");
    @unlink(getcwd() . "/mobile/Runtime/~runtime.php");
    Dir::delDir(getcwd() . "/update/Runtime/Cache/");
    Dir::delDir(getcwd() . "/update/Runtime/Data/");
    Dir::delDir(getcwd() . "/update/Runtime/Temp/");
    @unlink(getcwd() . "/update/Runtime/~app.php");
    @unlink(getcwd() . "/update/Runtime/~runtime.php");
}
Beispiel #5
0
 public function clear()
 {
     import("ORG.Io.Dir");
     $dir = './Admin/Runtime/';
     if (is_dir($dir)) {
         Dir::delDir($dir);
     }
     $this->success('清除成功!');
 }
Beispiel #6
0
 function deleteCache()
 {
     import('ORG.Io.Dir');
     $cacheDir = new Dir(APP_NAME . '/Runtime');
     if ($cacheDir->delDir(APP_NAME . '/Runtime')) {
         $this->success('清除缓存成功!');
     } else {
         $this->error('清除缓存失败!请联系管理员!');
     }
 }
 function Cache()
 {
     import("ORG.Io.Dir");
     if (file_exists('./Runtime')) {
         Dir::delDir('./Runtime');
     }
     $return[] = array('text' => '返回首页', 'link' => U('Index/index'));
     $this->assign('return', $return);
     $this->success('更新缓存成功!');
 }
Beispiel #8
0
 /**
  * 检测服务器环境
  */
 public function check()
 {
     $this->assign('step_curr', 'check');
     $flag = true;
     //检测文件夹权限
     $check_file = array('/data', '/data/advert', '/data/author', '/data/items', '/data/logs', '/data/logs/taobao', '/data/news', '/admin/Runtime', '/index/Runtime', '/index/Conf/theme.php', '/config.inc.php');
     $error = array();
     foreach ($check_file as $file) {
         $path_file = ROOT_PATH . $file;
         if (!file_exists($path_file)) {
             $error[] = $file . "不存在!";
             $flag = false;
             continue;
         }
         if (!is_writable($path_file)) {
             $error[] = $file . "不可读写!";
             $flag = false;
         }
     }
     if (!function_exists("curl_getinfo")) {
         $error[] = "系统不支持curl!";
         $flag = false;
     }
     if (!function_exists("gd_info")) {
         $error[] = "系统不支持GD!";
         $flag = false;
     }
     import("ORG.Io.Dir");
     $dir = new Dir();
     $dir->delDir("admin/Runtime");
     mkdir("admin/Runtime");
     $dir->delDir("index/Runtime");
     mkdir("index/Runtime");
     if (!$flag) {
         $this->assign('error', $error);
         $this->display('check');
     } else {
         $this->redirect('index/setconf');
     }
 }
 public function public_cache()
 {
     if (isset($_GET['type'])) {
         import("Dir");
         import('Cacheapi');
         $Cache = new Cacheapi();
         $Cachepath = RUNTIME_PATH;
         $Dir = new Dir();
         $type = $this->_get("type");
         switch ($type) {
             case "site":
                 try {
                     $Dir->del($Cachepath);
                     $Dir->del($Cachepath . "Data/");
                     $Dir->del($Cachepath . "Data/_fields/");
                 } catch (Exception $exc) {
                 }
                 try {
                     $cache = Cache::getInstance();
                     $cache->clear();
                 } catch (Exception $exc) {
                 }
                 $modules = array(array('name' => "菜单,模型,栏目缓存更新成功!", 'function' => 'site_cache', 'param' => ''), array('name' => "模型字段缓存更新成功!", 'function' => 'model_field_cache', 'param' => ''), array('name' => "模型content处理类缓存更新成功!", 'function' => 'model_content_cache', 'param' => ''), array('name' => "会员相关缓存更新成功!", 'function' => 'member_cache', 'param' => ''), array('name' => "应用更新成功!", 'function' => 'appstart_cache', 'param' => ''), array('name' => "敏感词缓存生成成功!", 'function' => 'censorword_cache', 'param' => ''));
                 foreach ($modules as $k => $v) {
                     try {
                         if ($v['function']) {
                             $Cache->{$v}['function']();
                         }
                     } catch (Exception $exc) {
                     }
                 }
                 $this->success("站点数据缓存更新成功!", U('Index/public_cache'));
                 break;
             case "template":
                 $Dir->delDir($Cachepath . "Cache/");
                 $this->success("模板缓存清理成功!", U('Index/public_cache'));
                 break;
             case "logs":
                 $Dir->del($Cachepath . "Logs/");
                 $this->success("站点日志清理成功!", U('Index/public_cache'));
                 break;
             default:
                 $this->error("请选择清楚缓存类型!");
                 break;
         }
     } else {
         $this->display("Index:cache");
     }
 }
 public function delCore()
 {
     import("ORG.Io.Dir");
     $dir = new Dir();
     @unlink(TEMP_PATH . '~runtime.php');
     //删除主编译缓存文件
     @unlink(TEMP_PATH . '~crons.php');
     //删除计划任务缓存文件
     @unlink(TEMP_PATH . 'cron.lock');
     //删除计划任务执行锁定文件
     if (is_dir(DATA_PATH)) {
         $dir->delDir(DATA_PATH);
     }
     if (is_dir(TEMP_PATH)) {
         $dir->delDir(TEMP_PATH);
     }
     if (is_dir(CACHE_PATH)) {
         $dir->delDir(CACHE_PATH);
     }
     if (is_dir(LOG_PATH)) {
         $dir->delDir(LOG_PATH);
     }
     echo '[清除成功]';
 }
 public function delCore()
 {
     import("ORG.Io.Dir");
     $dir = new Dir();
     @unlink('./Temp/~runtime.php');
     //删除主编译缓存文件
     @unlink('./Temp/~crons.php');
     //删除计划任务缓存文件
     @unlink('./Temp/cron.lock');
     //删除计划任务执行锁定文件
     if (is_dir('./Temp/Data')) {
         $dir->delDir('./Temp/Data');
     }
     if (is_dir('./Temp/Temp')) {
         $dir->delDir('./Temp/Temp');
     }
     if (is_dir('./Temp/Cache')) {
         $dir->delDir('./Temp/Cache');
     }
     if (is_dir('./Temp/Logs')) {
         $dir->delDir('./Temp/Logs');
     }
     echo '[清除成功]';
 }
 public function uninstall($module)
 {
     if (!$module) {
         $this->error("参数出错!");
     }
     $info = M("Module")->where(array("module" => $module))->find();
     if ($info) {
         define("UNINSTALL", true);
         import("Dir");
         //卸载目录
         $path = APP_PATH . C("APP_GROUP_PATH") . DIRECTORY_SEPARATOR . $module . DIRECTORY_SEPARATOR . 'Uninstall' . DIRECTORY_SEPARATOR;
         $Dir = new Dir();
         //SQL文件
         if (file_exists($path . $module . '.sql')) {
             $sql = file_get_contents($path . $module . '.sql');
             $sql_split = $this->sql_split($sql, C("DB_PREFIX"));
             $db = M('');
             if (is_array($sql_split)) {
                 foreach ($sql_split as $s) {
                     $db->execute($s);
                 }
             }
         }
         if (file_exists($path . 'Extention.inc.php')) {
             @(include $path . 'Extention.inc.php');
         }
         //前台模板
         if (file_exists($this->templatePath . $module . DIRECTORY_SEPARATOR)) {
             $Dir->delDir($this->templatePath . $module . DIRECTORY_SEPARATOR);
         }
         D("Module")->where(array("module" => $module))->delete();
         //删除权限
         M("Access")->where(array("g" => $module))->delete();
         return true;
     } else {
         $this->error("该模块不存在,无法卸载!");
     }
 }
Beispiel #13
0
 /**
  * 环境检测
  */
 public function check()
 {
     $flag = true;
     //检测文件夹权限
     $check_file = array('./data', './data/mail_tpl', './data/msg_tpl', './data/static', './data/upload', './data/config/db.php', './data/config/url.php', './data/config/home/config.php');
     $error = array();
     foreach ($check_file as $file) {
         $path_file = $file;
         if (!file_exists($path_file)) {
             $error[] = $file . L('not_exists');
             $flag = false;
             continue;
         }
         if (!is_writable($path_file)) {
             //if (!$this->is_really_writable($path_file)) {
             $error[] = $file . L('not_writable');
             $flag = false;
         }
     }
     if (!function_exists('curl_getinfo')) {
         $error[] = L('no_curl');
         $flag = false;
     }
     if (!function_exists('gd_info')) {
         $error[] = L('no_gd');
         $flag = false;
     }
     $dir_obj = new Dir();
     is_dir('./data/runtime') && $dir_obj->delDir('./data/runtime');
     if (!$flag) {
         $this->assign('error', $error);
         $this->assign('step_curr', 'check');
         $this->display('check');
     } else {
         $this->redirect('setconf');
     }
 }
 /**
  * 删除用户头像
  * @param type $uid 用户名
  * @return int 1:成功
  *                      0:失败
  */
 public function user_deleteavatar($uid)
 {
     if ($this->UCenter) {
         return uc_user_deleteavatar($uid);
     } else {
         $dr = C("UPLOADFILEPATH") . "avatar/" . $uid . '/';
         if (defined("CONFIG_FTPSTATUS") && CONFIG_FTPSTATUS) {
             $Attachment = service("Attachment");
             // 远程存放地址
             $remote = CONFIG_FTPUPPAT . str_replace(SITE_PATH . "/", "", $dr);
             $Attachment->FTPrmdir($remote, true);
         } else {
             if (is_dir($dr) == false) {
                 return 0;
             }
             import("Dir");
             $Dir = new Dir();
             $Dir->delDir($dr);
         }
         M("Member")->where(array("userid" => $uid))->save(array("userpic" => ""));
         return 1;
     }
 }
Beispiel #15
0
/**
 * 清空系统缓存,兼容sae
 */
function sp_clear_cache()
{
    import("ORG.Util.Dir");
    $dirs = array();
    // runtime/
    $rootdirs = sp_scan_dir(RUNTIME_PATH . "*");
    //$noneed_clear=array(".","..","Data");
    $noneed_clear = array(".", "..");
    $rootdirs = array_diff($rootdirs, $noneed_clear);
    foreach ($rootdirs as $dir) {
        if ($dir != "." && $dir != "..") {
            $dir = RUNTIME_PATH . $dir;
            if (is_dir($dir)) {
                //array_push ( $dirs, $dir );
                $tmprootdirs = sp_scan_dir($dir . "/*");
                foreach ($tmprootdirs as $tdir) {
                    if ($tdir != "." && $tdir != "..") {
                        $tdir = $dir . '/' . $tdir;
                        if (is_dir($tdir)) {
                            array_push($dirs, $tdir);
                        } else {
                            @unlink($tdir);
                        }
                    }
                }
            } else {
                @unlink($dir);
            }
        }
    }
    $dirtool = new \Dir("");
    foreach ($dirs as $dir) {
        $dirtool->delDir($dir);
    }
    if (sp_is_sae()) {
        $global_mc = @memcache_init();
        if ($global_mc) {
            $global_mc->flush();
        }
        $no_need_delete = array("THINKCMF_DYNAMIC_CONFIG");
        $kv = new SaeKV();
        // 初始化KVClient对象
        $ret = $kv->init();
        // 循环获取所有key-values
        $ret = $kv->pkrget('', 100);
        while (true) {
            foreach ($ret as $key => $value) {
                if (!in_array($key, $no_need_delete)) {
                    $kv->delete($key);
                }
            }
            end($ret);
            $start_key = key($ret);
            $i = count($ret);
            if ($i < 100) {
                break;
            }
            $ret = $kv->pkrget('', 100, $start_key);
        }
    }
}
 public function clear()
 {
     $type = $this->_get('type', 'trim');
     $obj_dir = new Dir();
     switch ($type) {
         case 'field':
             is_dir(DATA_PATH) && $obj_dir->del(DATA_PATH);
             break;
         case 'tpl':
             is_dir(CACHE_PATH) && $obj_dir->delDir(CACHE_PATH);
             break;
         case 'data':
             is_dir(DATA_PATH) && $obj_dir->del(DATA_PATH);
             is_dir(TEMP_PATH) && $obj_dir->delDir(TEMP_PATH);
             break;
         case 'runtime':
             @unlink(RUNTIME_FILE);
             break;
         case 'logs':
             is_dir(LOG_PATH) && $obj_dir->delDir(LOG_PATH);
             break;
     }
     $this->ajaxReturn(1);
 }
Beispiel #17
0
function clearCache()
{
    import("@.ORG.Dir");
    if (is_dir(HOME_PATH . "Runtime")) {
        Dir::delDir(HOME_PATH . "Runtime");
    }
    if (is_dir(APP_PATH . "Runtime")) {
        Dir::delDir(APP_PATH . "Runtime");
    }
    if (is_dir("../" . M_PATH . "Runtime")) {
        Dir::delDir("../" . M_PATH . "Runtime");
    }
}
 /**
  * 删除文件目录  函数
  */
 function delete_file()
 {
     //导入文件类,调用删除函数
     import("ORG.Io.Dir");
     $dir = new Dir();
     //得到需要删除的目录或文件名
     $del_name = trim($_POST['del_name']);
     //得到文件或目录路径
     $path = $_SESSION['path'] . '/' . $del_name;
     //判断是文件还是目录
     if (is_file($path)) {
         if (unlink($path) !== false) {
             $this->assign('jumpUrl', __URL__ . '/index');
             $this->success('文件删除成功');
         } else {
             $this->assign('jumpUrl', __URL__ . '/index');
             $this->error('文件删除失败,请联系管理员');
         }
     } else {
         if (is_dir($path)) {
             if ($dir->delDir($path) !== false) {
                 $this->assign('jumpUrl', __URL__ . '/index');
                 $this->success('目录删除成功');
             } else {
                 $this->assign('jumpUrl', __URL__ . '/index');
                 $this->error('目录删除失败,请联系管理员');
             }
         }
     }
 }
Beispiel #19
0
function clearCache()
{
    Dir::delDir(ROOT_PATH . '/Data/Runtime/Admin');
    @mkdir(ROOT_PATH . '/Data/Runtime/Admin', 0777);
    @chmod(ROOT_PATH . '/Data/Runtime/Admin', 0777);
}
Beispiel #20
0
 /**
  * @Title: clear_cache 
  * @Description: todo(清空缓存)   
  * @author liminggang 
  * @date 2014-8-28 下午6:40:24 
  * @throws
  */
 function clear_cache()
 {
     $obj_dir = new Dir();
     if ($_REQUEST['runtime'] == 1) {
         $directory = DConfig_PATH . "/AccessList";
         if (is_dir($directory)) {
             $obj_dir->del($directory);
         }
     }
     if ($_REQUEST['runtime'] == 3) {
         $directory = RUNTIME_PATH . "/Data/_fields";
         if (is_dir($directory)) {
             $obj_dir->del($directory);
         }
     }
     //清除整个目录,必须放在最下面
     if ($_REQUEST['runtime'] == 2) {
         $obj_dir->delDir(RUNTIME_PATH);
     }
     $this->success('删除缓存成功!');
 }
Beispiel #21
0
 public function delete_install()
 {
     import("ORG.Io.Dir");
     $dir = new Dir();
     $dir->delDir(ROOT_PATH . "/install");
     @unlink(ROOT_PATH . '/install.php');
     if (!is_dir(ROOT_PATH . "/install")) {
         $this->success(L('operation_success'));
     }
 }
Beispiel #22
0
function clearCache()
{
    Dir::delDir(FANWE_ROOT . './public/data/admin/runtime');
    @mkdir(FANWE_ROOT . './public/data/admin/runtime', 0777);
    @chmod(FANWE_ROOT . './public/data/admin/runtime', 0777);
}
Beispiel #23
0
 function delDir($directory, $subdir = true)
 {
     if (is_dir($directory) == false) {
         exit("The Directory Is Not Exist!");
     }
     $handle = opendir($directory);
     while (($file = readdir($handle)) !== false) {
         if ($file != "." && $file != "..") {
             is_dir("{$directory}/{$file}") ? Dir::delDir("{$directory}/{$file}") : unlink("{$directory}/{$file}");
         }
     }
     if (readdir($handle) == false) {
         closedir($handle);
         rmdir($directory);
     }
 }
 /**
 +----------------------------------------------------------
 * 删除目录(包括下面的文件)
 +----------------------------------------------------------
 * @access static
 +----------------------------------------------------------
 * @return void
 +----------------------------------------------------------
 */
 function delDir($directory, $subdir = true)
 {
     if (is_dir($directory) == false) {
         return false;
     }
     $handle = @opendir($directory);
     while (($file = readdir($handle)) !== false) {
         if ($file != "." && $file != "..") {
             is_dir("{$directory}/{$file}") ? Dir::delDir("{$directory}/{$file}") : @unlink("{$directory}/{$file}");
         }
     }
     if (readdir($handle) == false) {
         @closedir($handle);
         @rmdir($directory);
     }
     return true;
 }
Beispiel #25
0
 /**
  * 删除文件夹(包括下面的文件)
  * @param type $file 如果为数字,表示根据aid删除,其他为文件路径
  * @return boolean
  */
 public function delDir($dirPath)
 {
     $Dir = new \Dir();
     if ($Dir->delDir($dirPath)) {
         return true;
     } else {
         $this->error = $Dir->error;
         return false;
     }
 }
Beispiel #26
0
 public function login()
 {
     if (!isset($_SESSION[C('USER_AUTH_KEY')])) {
         //如果系统已安装,则删除安装文件包install
         if (is_file("../install/install.lock")) {
             import('@.ORG.Dir');
             Dir::delDir('../install');
         }
         $this->display();
     } else {
         $this->redirect('Index/index');
     }
 }
 /**
  * 上传头像 
  */
 public function uploadavatar()
 {
     $auth_data = authcode($_GET['auth_data'], "DECODE");
     if ($auth_data != AppframeAction::$Cache['uid']) {
         exit("0");
     }
     if (isset($GLOBALS['HTTP_RAW_POST_DATA'])) {
         //flashpost
         $avatardata = $GLOBALS['HTTP_RAW_POST_DATA'];
     }
     $dir = C("UPLOADFILEPATH") . "/avatar/" . AppframeAction::$Cache['uid'] . '/';
     //创建图片存储文件夹
     if (!file_exists($dir)) {
         mkdir($dir, 0777, true);
     }
     //存储flashpost图片压缩包 member/avatar/用户id/
     $filename = $dir . AppframeAction::$Cache['uid'] . ".zip";
     file_put_contents($filename, $avatardata);
     import("Pclzip");
     $archive = new PclZip($filename);
     if ($archive->extract(PCLZIP_OPT_PATH, $dir) == 0) {
         die("Error : " . $archive->errorInfo(true));
     }
     //判断文件安全,删除压缩包和非jpg图片
     $avatararr = array('180x180.jpg', '30x30.jpg', '45x45.jpg', '90x90.jpg');
     if (defined("CONFIG_FTPSTATUS") && CONFIG_FTPSTATUS) {
         import("UploadFile");
         import("Dir");
         $Dir = new Dir();
         $UploadFile = new UploadFile();
     }
     if ($handle = opendir($dir)) {
         while (false !== ($file = readdir($handle))) {
             if ($file !== '.' && $file !== '..') {
                 if (!in_array($file, $avatararr)) {
                     @unlink($dir . $file);
                 } else {
                     $info = @getimagesize($dir . $file);
                     if (!$info || $info[2] != 2) {
                         @unlink($dir . $file);
                     }
                 }
                 if (defined("CONFIG_FTPSTATUS") && CONFIG_FTPSTATUS) {
                     //如果有开启FTP,则上传到FTP上
                     $UploadFile->FTPuplode($dir . $file, $dir . $file);
                 }
             }
         }
         closedir($handle);
     }
     //如果是上传FTP,删除
     if (defined("CONFIG_FTPSTATUS") && CONFIG_FTPSTATUS) {
         $Dir->delDir($dir);
     }
     //保存头像地址到数据库,默认保存90x90.jpg
     //20121214 废除,userpic用于保存非本地头像,例如QQ登陆后的第三方头像。
     //M("Member")->where(array("userid" => AppframeAction::$Cache['uid']))->save(array("userpic" => "avatar/" . AppframeAction::$Cache['uid'] . '/90x90.jpg'));
     exit('1');
 }
Beispiel #28
0
 /**
  +----------------------------------------------------------
 * 删除目录(包括下面的文件)
  +----------------------------------------------------------
 * @access static
  +----------------------------------------------------------
 * @return void
  +----------------------------------------------------------
 */
 function delDir($directory, $subdir = true)
 {
     if (is_dir($directory) == false) {
         $this->error = "该目录是不存在!";
         return false;
     }
     $handle = opendir($directory);
     while (($file = readdir($handle)) !== false) {
         if ($file != "." && $file != "..") {
             is_dir("{$directory}/{$file}") ? Dir::delDir("{$directory}/{$file}") : unlink("{$directory}/{$file}");
         }
     }
     if (readdir($handle) == false) {
         closedir($handle);
         rmdir($directory);
     }
 }
 /**
  * 删除备份
  */
 public function del_backup()
 {
     if ((!isset($_GET['backup']) || empty($_GET['backup'])) && (!isset($_POST['backup']) || empty($_POST['backup']))) {
         $this->error('非法参数');
     }
     import('@.ORG.Dir');
     $dir = new \Dir();
     $dir->delDir(SITE_PATH . $this->backup_path . $_GET['backup'] . '/');
     $this->success('操作成功!');
 }
Beispiel #30
0
 /**
  * 删除备份
  */
 public function del_backup()
 {
     if ((!isset($_GET['backup']) || empty($_GET['backup'])) && (!isset($_POST['backup']) || empty($_POST['backup']))) {
         $this->error(L('illegal_parameters'));
     }
     import('@.ORG.Dir');
     $dir = new Dir();
     $dir->delDir(FTX_DATA_PATH . $this->backup_path . $_GET['backup'] . '/');
     $this->success(L('operation_success'));
 }