当前位置: 首页>>代码示例>>PHP>>正文


PHP delete_dir函数代码示例

本文整理汇总了PHP中delete_dir函数的典型用法代码示例。如果您正苦于以下问题:PHP delete_dir函数的具体用法?PHP delete_dir怎么用?PHP delete_dir使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了delete_dir函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: scan_dir

function scan_dir($id)
{
    $result = true;
    foreach ($GLOBALS['db']->select("dir", ['owner' => $_SESSION["username"], 'parent' => $id]) as $d) {
        $result = scan_dir($d["id"]);
    }
    $result = delete_dir($id);
    return $result;
}
开发者ID:BirkhoffLee,项目名称:allendisk,代码行数:9,代码来源:ajax_delete_dir.php

示例2: delete_dirs

function delete_dirs($dirs)
{
    $rtn = 1;
    foreach ($dirs as $dir) {
        if (!delete_dir($dir)) {
            $rtn = 0;
        }
    }
    return $rtn;
}
开发者ID:joshuamorse,项目名称:flava_framework,代码行数:10,代码来源:plugins.functions.php

示例3: uninstall

function uninstall()
{
    global $_plugin;
    global $success;
    global $error;
    global $errors;
    plugin_is_installed($_plugin['name']) or $error = $errors['not_installed'];
    delete_dir($_plugin['dir']['definitions']) or $error = $errors['delete_dir'];
    set_as_uninstalled() or $error = $errors['uninstalling'];
    $success = $_plugin['name'] . ' was successfully uninstalled';
}
开发者ID:joshuamorse,项目名称:flava_framework,代码行数:11,代码来源:ops.php

示例4: bannerZoneDelete

 public function bannerZoneDelete($id)
 {
     $this->load->helper('directory');
     $this->db->trans_start();
     $this->db->where('id', $id);
     $this->db->delete('banners_zones');
     $this->db->where('parent_id', $id);
     $this->db->delete('banners_banners');
     $this->db->trans_complete();
     delete_dir(APPPATH . 'assets/images/banners/' . $id);
 }
开发者ID:npirotte,项目名称:npirotte-2013.be,代码行数:11,代码来源:banners_model.php

示例5: delete_dir

function delete_dir($dir)
{
    if (!is_dir($dir)) {
        return 1;
    }
    $handle = @glob($dir . "/*");
    for ($i = 0; $i < count($handle); $i++) {
        is_dir($handle[$i]) ? delete_dir($handle[$i]) : unlink($handle[$i]);
    }
    rmdir($dir);
    return is_dir($dir) ? 1 : 0;
}
开发者ID:ASDAFF,项目名称:Shells-Database,代码行数:12,代码来源:cshell.php

示例6: delete_dir

 private function delete_dir($src)
 {
     $dir = opendir($src);
     while (false !== ($file = readdir($dir))) {
         if ($file != '.' && $file != '..') {
             if (is_dir($src . '/' . $file)) {
                 delete_dir($src . '/' . $file);
             } else {
                 unlink($src . '/' . $file);
             }
         }
     }
     rmdir($src);
     closedir($dir);
 }
开发者ID:fbmfbm,项目名称:drhil01,代码行数:15,代码来源:ajax_faq.php

示例7: delete_dir

/**
 * Deleting a folder recursively
 * @ingroup G-0003
 */
function delete_dir($path)
{
    $file_scan = scandir($path);
    foreach ($file_scan as $filecheck) {
        $file_extension = pathinfo($filecheck, PATHINFO_EXTENSION);
        if ($filecheck != '.' && $filecheck != '..') {
            if ($file_extension == '') {
                delete_dir($path . $filecheck . '/');
            } else {
                unlink($path . $filecheck);
            }
        }
    }
    rmdir($path);
}
开发者ID:Kaoticshadow,项目名称:SOEN390_ATeam,代码行数:19,代码来源:narrative_editing_helper.php

示例8: delete_dir

function delete_dir($dirPath)
{
    if (substr($dirPath, strlen($dirPath) - 1, 1) != '/') {
        $dirPath .= '/';
    }
    $files = glob($dirPath . '*', GLOB_MARK);
    foreach ($files as $file) {
        if (is_dir($file)) {
            delete_dir($file);
        } else {
            unlink($file);
        }
    }
    rmdir($dirPath);
}
开发者ID:Kakadua,项目名称:Youtube-Emby-generator,代码行数:15,代码来源:download.php

示例9: delete_dir

function delete_dir($dir)
{
    if (!file_exists($dir)) {
        return true;
    }
    if (!is_dir($dir)) {
        return @unlink($dir);
    }
    foreach (scandir($dir) as $item) {
        if ($item == '.' || $item == '..') {
            continue;
        }
        if (!delete_dir($dir . DIRECTORY_SEPARATOR . $item)) {
            return false;
        }
    }
    return rmdir($dir);
}
开发者ID:alfonkdp,项目名称:soad,代码行数:18,代码来源:myfiles_helper.php

示例10: delete_dir

function delete_dir($dirPath)
{
    if (!is_dir($dirPath)) {
        throw new InvalidArgumentException("{$dirPath} must be a directory");
    }
    if (substr($dirPath, strlen($dirPath) - 1, 1) != '/') {
        $dirPath .= '/';
    }
    $files = glob($dirPath . '*', GLOB_MARK);
    foreach ($files as $file) {
        if (is_dir($file)) {
            delete_dir($file);
        } else {
            unlink($file);
        }
    }
    rmdir($dirPath);
}
开发者ID:lekoala,项目名称:silverstripe-327,代码行数:18,代码来源:migrate.php

示例11: delete_dir

function delete_dir($dir)
{
    if (($dh = opendir($dir)) != false) {
        while (($file = readdir($dh)) !== false) {
            if ($file === '.' || $file === '..') {
                continue;
            }
            $file = $dir . $file;
            if (is_dir($file)) {
                delete_dir($file . '/');
            } else {
                unlink($file);
            }
        }
        closedir($dh);
    }
    rmdir($dir);
}
开发者ID:omusico,项目名称:isle-web-framework,代码行数:18,代码来源:tools.php

示例12: clear_cache

 /**
  * 调用清除缓存数据
  */
 function clear_cache()
 {
     //调用common里面的delete_dir()函数删除目录
     $dir = RUNTIME_PATH;
     //由于Runtime_path默认为 "./admin/Runtime/",我们必须删除最后的 “/”
     $dir = substr($dir, 0, strlen($dir) - 1);
     if (delete_dir($dir)) {
         //清空前台缓存
         $front_dir = './Home/Runtime';
         delete_dir($front_dir);
         //清空静态缓存目录
         delete_dir(HTML_PATH);
         //调用显示模板
         $this->assign("jumpUrl", "__APP__/Manage/index");
         $this->success("缓存清除成功,页面跳转中~~~");
     } else {
         $this->assign("jumpUrl", "__APP__/Manage/index");
         $this->error("缓存清除失败,返回控制面板!");
     }
 }
开发者ID:omusico,项目名称:AndyCMS,代码行数:23,代码来源:ToolAction.class.php

示例13: deleteDir

	private function deleteDir($location){
		if(is_dir($location)) {
					$all = @opendir($location);
					while (false !== ($file = @readdir($all))) {
						if (is_dir("$location/$file") && $file != '..' && $file != '.') {
							delete_dir("$location/$file");
						} elseif (is_file("$location/$file")) {
							@unlink("$location/$file");
						}
						unset($file);
					}
					closedir($all);
					@rmdir($location);
			} else {
					if (file_exists($location)) {
						@unlink($location);
					}
			}
			return true;
	}
开发者ID:ripen,项目名称:OCS,代码行数:20,代码来源:ocsService.php

示例14: importAction

 public function importAction()
 {
     $dir = DATA_DIR . 'bakup' . DIRECTORY_SEPARATOR;
     $path = $this->get('path');
     if ($path && is_dir($dir . $path)) {
         $fileid = $this->get('fileid');
         $this->importdb($path, $fileid);
         exit;
     }
     if ($this->post('submit')) {
         $paths = $this->post('paths');
         if (is_array($paths)) {
             foreach ($paths as $path) {
                 delete_dir($dir . $path . '/');
                 @rmdir($dir . $path);
             }
         }
         $this->show_message('操作成功', 1, url('database/import'));
     }
     if (!is_dir($dir)) {
         mkdirs($dir);
     }
     $file_list = glob($dir . '*');
     $list = array();
     foreach ($file_list as $v) {
         if (is_dir($v)) {
             $size = 0;
             $_dir = glob($v . DIRECTORY_SEPARATOR . '*.sql');
             foreach ($_dir as $c) {
                 $size += filesize($c);
             }
             $path = basename($v);
             $sqldir = '/data/bakup/' . $path . '/';
             $list[] = array('path' => $path, 'size' => file_size_count($size), 'sqldir' => $sqldir);
         }
     }
     include $this->admin_tpl('database_import');
 }
开发者ID:43431655,项目名称:qizhongbao,代码行数:38,代码来源:database.php

示例15: delete_thumbnaildir

 private function delete_thumbnaildir()
 {
     $thumbnailsdir = SlideshowJedoGallery::thumbnails_slideshowjedogallery_path();
     if (file_exists($thumbnailsdir)) {
         @chmod($thumbnailsdir, 0777);
         //삭제하려는 폴더의 퍼미션을 777로 재 지정
         $directory = dir($thumbnailsdir);
         while ($entry = $directory->read()) {
             if ($entry != "." && $entry != "..") {
                 if (is_dir($thumbnailsdir . "/" . $entry)) {
                     //삭제하려는 폴더안에 서브 폴더가 있을경우 재루프
                     delete_dir($thumbnailsdir . "/" . $entry);
                 } else {
                     @chmod($thumbnailsdir . "/" . $entry, 0777);
                     //삭제하려는 폴더안에 파일일 경우 파일 퍼미션을 777로 재지정
                     @UnLink($thumbnailsdir . "/" . $entry);
                 }
             }
         }
         $directory->close();
         @rmdir($thumbnailsdir);
     }
     return false;
 }
开发者ID:jedoson,项目名称:slideshowjedogallery,代码行数:24,代码来源:SlideshowJedoGalleryInstaller.php


注:本文中的delete_dir函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。