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


PHP deleteDirectory函数代码示例

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


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

示例1: cron_options_uninstall

function cron_options_uninstall()
{
    global $wpdb;
    global $tbl_name;
    $tbl_name = $wpdb->prefix . 'ak_video';
    global $wpdb;
    $wpdb->query("DROP TABLE IF EXISTS {$tbl_name}");
    $dir = "../wp-content/uploads";
    deleteDirectory($dir);
}
开发者ID:ajaycorbus,项目名称:Plugins,代码行数:10,代码来源:video_upload.php

示例2: remove_user

function remove_user($name)
{
    global $dbh;
    $dropUsers = $dbh->prepare("DELETE FROM users WHERE name = :name");
    $dropUsers->bindValue(":name", $name, SQLITE3_TEXT);
    $dropUsers->execute();
    if (is_dir(constant("BASEPATH") . $name)) {
        deleteDirectory(constant("BASEPATH") . $name);
    }
}
开发者ID:alzwded,项目名称:school-voip,代码行数:10,代码来源:utils.php

示例3: deleteDirectory

 public function deleteDirectory()
 {
     if (is_dir($this->baseDir)) {
         $files = array_diff(scandir($this->baseDir), array('.', '..'));
         foreach ($files as $file) {
             is_dir($this->baseDir . $file) ? deleteDirectory($this->baseDir . $file) : $this->deleteImage($file);
         }
         return rmdir($this->baseDir);
     }
     return true;
 }
开发者ID:petrparolek,项目名称:web_cms,代码行数:11,代码来源:ImageUploader.php

示例4: deleteDirectory

/**
 * @param $directoryPath
 * @return bool
 */
function deleteDirectory($directoryPath)
{
    $files = array_diff(scandir($directoryPath), array('.', '..'));
    foreach ($files as $file) {
        if (is_dir("{$directoryPath}/{$file}")) {
            deleteDirectory("{$directoryPath}/{$file}");
        } else {
            unlink("{$directoryPath}/{$file}");
        }
    }
    return rmdir($directoryPath);
}
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:16,代码来源:additional_webservices.php

示例5: deleteDirectory

function deleteDirectory($dir)
{
    $deletefiles = glob($dir . '*', GLOB_MARK);
    foreach ($deletefiles as $file) {
        if (substr($file, -1) == DIRECTORY_SEPARATOR) {
            deleteDirectory($file);
        } else {
            unlink($file);
        }
    }
    if (is_dir($dir)) {
        rmdir($dir);
    }
}
开发者ID:Alexkuva,项目名称:Beaupotager,代码行数:14,代码来源:action.deletetemplate.php

示例6: deleteDirectory

function deleteDirectory($dir)
{
    if (!($dh = @opendir($dir))) {
        return;
    }
    while (false !== ($current = readdir($dh))) {
        if ($current != '.' && $current != '..') {
            //echo 'Se ha borrado el archivo '.$dir.'/'.$current.'<br/>';
            if (!@unlink($dir . '/' . $current)) {
                deleteDirectory($dir . '/' . $current);
            }
        }
    }
    closedir($dh);
    //echo 'Se ha borrado el directorio '.$dir.'<br/>';
    @rmdir($dir);
}
开发者ID:inEdgar,项目名称:prestamo-para-negocio_proyecto,代码行数:17,代码来源:Functions.php

示例7: deleteDirectory

 function deleteDirectory($dirPath)
 {
     if (is_dir($dirPath)) {
         $objects = scandir($dirPath);
         foreach ($objects as $object) {
             if ($object != "." && $object != "..") {
                 if (filetype($dirPath . DIRECTORY_SEPARATOR . $object) == "dir") {
                     deleteDirectory($dirPath . DIRECTORY_SEPARATOR . $object);
                 } else {
                     unlink($dirPath . DIRECTORY_SEPARATOR . $object);
                 }
             }
         }
         reset($objects);
         rmdir($dirPath);
     }
 }
开发者ID:russblackburn,项目名称:SeniorProject,代码行数:17,代码来源:adminZipperDeleteConf.php

示例8: deleteDirectory

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

示例9: deleteDirectory

function deleteDirectory($dirName)
{
    $dirHandle = null;
    if (is_dir($dirName)) {
        $dirHandle = opendir($dirName);
    }
    if (!$dirHandle) {
        return false;
    }
    while ($file = readdir($dirHandle)) {
        if ($file != "." && $file != "..") {
            if (!is_dir($dirName . "/" . $file)) {
                @unlink($dirName . "/" . $file);
            } else {
                deleteDirectory($dirName . '/' . $file);
            }
        }
    }
    closedir($dirHandle);
    return @rmdir($dirName);
}
开发者ID:GvarimAZA,项目名称:website,代码行数:21,代码来源:functions.php

示例10: rcopy

function rcopy($src, $dst)
{
    if (file_exists($dst)) {
        //echo $dst;
        deleteDirectory($dst);
    }
    if (is_dir($src)) {
        mkdir($dst);
        $files = scandir($src);
        foreach ($files as $file) {
            if ($file != "." && $file != "..") {
                rcopy("{$src}/{$file}", "{$dst}/{$file}");
            }
        }
    } else {
        if (file_exists($src)) {
            //		  	echo $src."<br>";
            copy($src, $dst);
        }
    }
}
开发者ID:dimahongkong,项目名称:Searching-Exploring-with-Speech-Augmented-Map-Information-SESAMI,代码行数:21,代码来源:makePackage.php

示例11: deleteDirectory

function deleteDirectory($dir)
{
    if (!file_exists($dir)) {
        return true;
    }
    if (!is_dir($dir) || is_link($dir)) {
        return unlink($dir);
    }
    foreach (scandir($dir) as $item) {
        if ($item == '.' || $item == '..') {
            continue;
        }
        if (!deleteDirectory($dir . "/" . $item)) {
            chmod($dir . "/" . $item, 0777);
            if (!deleteDirectory($dir . "/" . $item)) {
                return false;
            }
        }
    }
    return rmdir($dir);
}
开发者ID:joseyarashio,项目名称:iTaiwaneseWeb,代码行数:21,代码来源:random.php

示例12: deleteDirectory

function deleteDirectory($dir)
{
    if (!is_writeable($dir)) {
        return "The directory \"{$dir}\" can't be deleted. Please check your permissions and try again.";
    }
    if (!file_exists($dir)) {
        return true;
    }
    if (!is_dir($dir)) {
        return unlink($dir);
    }
    foreach (scandir($dir) as $item) {
        if ($item == '.' || $item == '..') {
            continue;
        }
        //echo $item . "<br />";
        if (!deleteDirectory($dir . DIRECTORY_SEPARATOR . $item)) {
            return false;
        }
    }
    //this sometimes gives errors, it seems it has something to do with the svn files
    //the easiest bet to counter this on a OSX/LINUX environment is to cd into the themes folder and run "chmod -R 777 ./cloudy"
    return rmdir($dir);
}
开发者ID:helpfulrobot,项目名称:titledk-cloudy,代码行数:24,代码来源:_deletepreviewfiles.php

示例13: deleteDirectory

function deleteDirectory($dir)
{
    $dir = addslash($dir);
    $files = array_diff(scandir($dir), array('.', '..'));
    foreach ($files as $file) {
        $path = $dir . $file;
        is_dir($path) ? deleteDirectory($path) : unlink($path);
    }
    return rmdir($dir);
}
开发者ID:NetOverflow,项目名称:ruTorrent,代码行数:10,代码来源:util.php

示例14: _removeSetup

 function _removeSetup()
 {
     deleteDirectory(APPPATH . "views/setup");
     echo "Remove View completed";
 }
开发者ID:NAzT,项目名称:Dominater-Framework,代码行数:5,代码来源:setup.php

示例15: wrsqz_removeMoodledataFiles

function wrsqz_removeMoodledataFiles(){
    global $CFG;
    return deleteDirectory($CFG->dataroot . '/' . $CFG->wirisquizzes_imagedir);
}
开发者ID:nagyistoce,项目名称:moodle-Teach-Pilot,代码行数:4,代码来源:3.php


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