示例#1
0
 public function delbak()
 {
     $db_dir = C("DB_BAKPATH");
     $dirname = explode(",", $_REQUEST['idarr']);
     foreach ($dirname as $v) {
         Rmall($db_dir . "/" . $v);
     }
     $this->success(L('删除成功'), '', array("data" => $_REQUEST['idarr']));
 }
示例#2
0
文件: Lib.php 项目: hutao1004/yintt
function Rmall($dirname)
{
    if (!file_exists($dirname)) {
        return false;
    }
    if (is_file($dirname) || is_link($dirname)) {
        return unlink($dirname);
    }
    $dir = dir($dirname);
    //如果对像是目录
    while (false !== ($file = $dir->read())) {
        if ($file == '.' || $file == '..') {
            continue;
        }
        if (!is_dir($dirname . "/" . $file)) {
            unlink($dirname . "/" . $file);
        } else {
            Rmall($dirname . "/" . $file);
        }
        rmdir($dirname . "/" . $file);
    }
    $dir->close();
    rmdir($dirname);
    return true;
}