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


PHP removeDirectory函数代码示例

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


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

示例1: removeDirectory

function removeDirectory($dir)
{
    if ($objs = glob($dir . "/*")) {
        foreach ($objs as $obj) {
            is_dir($obj) ? removeDirectory($obj) : unlink($obj);
        }
    }
    rmdir($dir);
}
开发者ID:arestotel,项目名称:project,代码行数:9,代码来源:func.php

示例2: removeDirectory

function removeDirectory($dir) {
    if ($objs = glob($dir."/*")) {
       foreach($objs as $obj) {
         is_dir($obj) ? removeDirectory($obj) : unlink($obj);
       }
    }
	echo "Удаление ".$dir."</br>";
    rmdir($dir);
  }
开发者ID:qquk,项目名称:IBAG,代码行数:9,代码来源:cleandir.php

示例3: deleteDir

 public function deleteDir($id_new)
 {
     $dir = 'load/' . $id_new;
     if ($objs = glob($dir . "/*")) {
         foreach ($objs as $obj) {
             is_dir($obj) ? removeDirectory($obj) : unlink($obj);
         }
     }
     rmdir($dir);
 }
开发者ID:Baron-fon-Kolt,项目名称:black_company,代码行数:10,代码来源:imgLoad.php

示例4: removeDirectory

function removeDirectory($dir)
{
    if ($objs = glob($dir . "/*")) {
        foreach ($objs as $obj) {
            var_dump($dir);
            is_dir($obj) ? removeDirectory($obj) : unlink($obj);
        }
    }
    rmdir($dir);
    echo "Каталог " . $dir . " успешно удален";
}
开发者ID:itmo-it-group-305,项目名称:nataliya.saveleva-php,代码行数:11,代码来源:index5.1_recursion_dz.php

示例5: removeDirectory

/**
 * @param string $dir
 * @return bool
 */
function removeDirectory($dir)
{
    foreach (new DirectoryIterator($dir) as $fi) {
        if ($fi->isDot()) {
            continue;
        } elseif ($fi->isFile()) {
            unlink($fi->getRealPath());
        } elseif ($fi->isDir()) {
            removeDirectory($fi->getRealPath());
        }
    }
    return rmdir($dir);
}
开发者ID:wwtg99,项目名称:flight2wwu,代码行数:17,代码来源:wwtinit.php

示例6: removeDirectory

/**
 * @param string $dir
 */
function removeDirectory($dir)
{
    foreach (scandir($dir) as $file) {
        if ('.' === $file || '..' === $file) {
            continue;
        }
        if (is_dir("{$dir}/{$file}")) {
            removeDirectory("{$dir}/{$file}");
        } else {
            unlink("{$dir}/{$file}");
        }
    }
    rmdir($dir);
}
开发者ID:aplazame,项目名称:prestashop,代码行数:17,代码来源:install-3.0.0.php

示例7: removeDirectory

function removeDirectory($dir)
{
    if (is_dir($dir)) {
        $dir = rtrim($dir, '/');
        $handle = dir($dir);
        while (($file = $handle->read()) !== false) {
            if ($file == '.' || $file == '..') {
                continue;
            }
            $f = $dir . DIRECTORY_SEPARATOR . $file;
            if (!is_link($f) && is_dir($f)) {
                removeDirectory($f);
            } else {
                @unlink($f);
            }
        }
        $handle->close();
        @rmdir($dir);
        return true;
    }
    return false;
}
开发者ID:laiello,项目名称:suitex,代码行数:22,代码来源:dl.php

示例8: Delete

 public function Delete()
 {
     global $db_connection;
     global $link_prefix;
     $file_path = '';
     foreach ($this->path_to_file as $key => $value) {
         $file_path .= $value . '/';
     }
     $file_path .= $this->name;
     $file_path = $_SERVER['DOCUMENT_ROOT'] . $link_prefix . $file_path;
     if (!file_exists($file_path)) {
         return Error::not_found;
     }
     $res = NULL;
     if (!$this->is_directory) {
         unlink($file_path);
         $res = $db_connection->query("DELETE FROM " . self::$table . " WHERE id = " . $this->id);
     } else {
         removeDirectory($file_path);
         $tmp = $this->path_to_file;
         array_push($tmp, $this->name);
         $tmp = json_encode($tmp);
         $tmp = $db_connection->real_escape_string(str_replace(']', '', $tmp));
         $res = $db_connection->query("DELETE FROM " . self::$table . " WHERE path_to_file LIKE(\"" . $tmp . "%\") ESCAPE '|'");
         if ($res) {
             $res = $db_connection->query("DELETE FROM " . self::$table . " WHERE id = " . $this->id);
         }
     }
     if (!$res) {
         return new Error($db_connection->error, Error::db_error);
     }
     return true;
 }
开发者ID:Gerold103,项目名称:lgmis,代码行数:33,代码来源:myfile.php

示例9: removeDirectory

 function removeDirectory($dir)
 {
     if ($objs = glob($dir . "/*")) {
         foreach ($objs as $obj) {
             is_dir($obj) ? removeDirectory($obj) : unlink($obj);
         }
     }
     rmdir("./" . $this->dir . $b['folder'] . "/");
 }
开发者ID:Sywooch,项目名称:dump,代码行数:9,代码来源:upload.php

示例10: del_models_allst

 public function del_models_allst()
 {
     $this->lib_auth->check_admin();
     $id = $_POST['id'];
     $name = $_POST['name'];
     $file = $_POST['file'];
     $this->db->where('id', $id);
     if ($this->db->delete('new_models')) {
         $path = $_SERVER['DOCUMENT_ROOT'] . '/img/genPhoto/' . $file;
         if (unlink($path)) {
             $dir = $_SERVER['DOCUMENT_ROOT'] . '/img/models/' . $name;
             if ($objs = glob($dir . "/*")) {
                 foreach ($objs as $obj) {
                     is_dir($obj) ? removeDirectory($obj) : unlink($obj);
                 }
             }
             rmdir($dir);
             echo "<script>alert('Удаление прошло успешно!');</script>";
             echo "<script>window.location.href = 'http://aitinimodels.com/general/manageofmodel'</script>";
         }
     }
 }
开发者ID:Vladimirtishenko,项目名称:aitini,代码行数:22,代码来源:general.php

示例11: auto

 public function auto()
 {
     $timeOut = (int) mainConfiguration::getInstance()->get("modules", "exchange.commerceML.timeout");
     if ($timeOut < 0) {
         $timeOut = 0;
     }
     sleep($timeOut);
     $buffer = outputBuffer::current('HTTPOutputBuffer');
     $buffer->charset('utf-8');
     $buffer->contentType('text/plain');
     $type = getRequest("type");
     $mode = getRequest("mode");
     $instance1c = getRequest('param0') ? md5(getRequest('param0')) . "/" : '';
     self::$importDirectory = "./sys-temp/1c_import/" . $instance1c;
     if (!permissionsCollection::getInstance()->isSv()) {
         $buffer->push("failure\nNot authorized as supervisor.");
         $buffer->end();
         exit;
     }
     switch ($type . "-" . $mode) {
         case "catalog-checkauth":
             // clear temp
             removeDirectory(self::$importDirectory);
         case "sale-checkauth":
             $buffer->push("success\nPHPSESSID\n" . session_id());
             break;
         case "catalog-init":
         case "sale-init":
             removeDirectory(self::$importDirectory);
             $maxFileSize = (int) mainConfiguration::getInstance()->get("modules", "exchange.commerceML.maxFileSize");
             if ($maxFileSize <= 0) {
                 $maxFileSize = 102400;
             }
             $buffer->push("zip=no\nfile_limit={$maxFileSize}");
             break;
         case "catalog-file":
             $buffer->push(self::saveIncomingFile());
             break;
         case "catalog-import":
             $buffer->push(self::importCommerceML());
             break;
         case "sale-query":
             $buffer->push(self::exportOrders());
             break;
         case "sale-success":
             $buffer->push(self::markExportedOrders());
             break;
         case "sale-file":
             $buffer->push(self::importOrders());
             break;
         default:
             $buffer->push("failure\nUnknown import type ({$type}) or mode ({$mode}).");
     }
     $buffer->end();
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:55,代码来源:__auto.php

示例12: Delete

 public static function Delete($id)
 {
     global $db_connection;
     global $link_to_direction_images;
     global $link_to_logo;
     $direction = Direction::FetchByID($id);
     $langs = $direction->FetchLanguages();
     $from_table = Direction::$table;
     if ($direction->language !== 'rus') {
         $from_table .= '_' . $direction->language;
     }
     if (!$db_connection->query("DELETE FROM `" . $from_table . "` WHERE `id` = " . $id)) {
         return 0;
     } else {
         if (count($langs) < 2) {
             $projs = Project::FetchByDirectionID($id, array('all'));
             if ($projs != NULL) {
                 for ($i = 0, $size = count($projs); $i < $size; ++$i) {
                     if (!$projs[$i]->DeleteThis()) {
                         echo 'error while deleting projects on proj id: ' . $projs[$i]->id;
                         return 0;
                     }
                 }
             }
             removeDirectory($link_to_direction_images . $id);
         } else {
             if ($direction->path_to_image !== $link_to_logo) {
                 unlink($direction->path_to_image);
             }
         }
         return 1;
     }
 }
开发者ID:Gerold103,项目名称:lgmis,代码行数:33,代码来源:direction.php

示例13: rmdir

        if ($file->isDir()) {
            rmdir($file->getRealPath());
            continue;
        }
        unlink($file->getRealPath());
    }
    rmdir($directory);
}
$phpCodeSnifferDir = __DIR__ . '/vendor/squizlabs/php_codesniffer';
if (!file_exists($phpCodeSnifferDir)) {
    throw new \RuntimeException('Could not find PHP_CodeSniffer dependency. ' . 'Did you maybe forget to run "php composer.phar install --prefer-source --dev"?');
}
$sniffTestSuiteFile = $phpCodeSnifferDir . '/tests/Standards/AllSniffs.php';
if (!file_exists($sniffTestSuiteFile)) {
    throw new \RuntimeException('Could not find PHP_CodeSniffer test suite. ' . 'Did you maybe forget to run composer installation with option "--prefer-source"?');
}
require_once __DIR__ . '/vendor/autoload.php';
$calisthenicsStandardDir = $phpCodeSnifferDir . '/CodeSniffer/Standards/ObjectCalisthenics';
if (file_exists($calisthenicsStandardDir)) {
    removeDirectory($calisthenicsStandardDir);
}
mkdir($calisthenicsStandardDir);
mkdir($calisthenicsStandardDir . '/Sniffs');
mkdir($calisthenicsStandardDir . '/Tests');
copy(__DIR__ . '/LICENSE', $calisthenicsStandardDir . '/LICENSE');
copy(__DIR__ . '/ruleset.xml', $calisthenicsStandardDir . '/ruleset.xml');
copy(__DIR__ . '/DataStructureLengthSniff.php', $calisthenicsStandardDir . '/DataStructureLengthSniff.php');
copy(__DIR__ . '/IdentifierLengthSniff.php', $calisthenicsStandardDir . '/IdentifierLengthSniff.php');
copy(__DIR__ . '/PropertyTypePerClassLimitSniff.php', $calisthenicsStandardDir . '/PropertyTypePerClassLimitSniff.php');
copyDirectory(__DIR__ . '/Sniffs', $calisthenicsStandardDir . '/Sniffs');
copyDirectory(__DIR__ . '/Tests', $calisthenicsStandardDir . '/Tests');
开发者ID:mauricecalhoun,项目名称:phpcs-calisthenics-rules,代码行数:31,代码来源:bootstrap.php

示例14: removeDirectory

 static function removeDirectory($path)
 {
     $path = rtrim(strval($path), '/');
     $d = dir($path);
     if (!$d) {
         return false;
     }
     while (false !== ($current = $d->read())) {
         if ($current === '.' || $current === '..') {
             continue;
         }
         $file = $d->path . '/' . $current;
         if (is_dir($file)) {
             removeDirectory($file);
         }
         if (is_file($file)) {
             unlink($file);
         }
     }
     rmdir($d->path);
     $d->close();
     return true;
 }
开发者ID:jluislechado,项目名称:podcast,代码行数:23,代码来源:Metodos.php

示例15: escape

     $mQuery = $mysql->query("SELECT `thread`, `poster` FROM `comments` WHERE `id` = '" . escape($_GET['comment']) . "'");
     if ($mQuery->num_rows) {
         $mData = $mQuery->fetch_assoc();
     } else {
         die("You have followed an invalid link.");
     }
     if (!$permissions['deletepost'] && (!$permissions['deleteownposts'] || $mData['poster'] != $_SESSION['accountid'])) {
         redirect("errors/permissions.html");
     }
     $mysql->query("DELETE FROM `comments` WHERE `id` = '" . escape($_GET['comment']) . "'");
     $mysql->query("DELETE FROM `likes` WHERE `thread` = '0' AND `post` = '" . escape($_GET['comment']) . "'");
     $attachmentsQuery = $mysql->query("SELECT `path` FROM `attachments` WHERE `thread` = '0' AND `post` = '" . escape($_GET['comment']) . "' LIMIT 1");
     if ($attachmentsQuery->num_rows) {
         while ($attachmentsData = $attachmentsQuery->fetch_assoc()) {
             $splitPath = explode("/", $attachmentsData['path']);
             removeDirectory("attachments/" . $splitPath[1] . "");
         }
     }
     $mysql->query("DELETE FROM `attachments` WHERE `thread` = '0' AND `post` = '" . escape($_GET['comment']) . "'");
     $commentQuery = $mysql->query("SELECT `date` FROM `comments` WHERE `thread` = '" . $mData['thread'] . "' ORDER BY `date` DESC LIMIT 1");
     if ($commentQuery->num_rows) {
         $commentData = $commentQuery->fetch_assoc();
         $mysql->query("UPDATE `threads` SET `lastpost` = '" . $commentData['date'] . "' WHERE `id` = '" . $mData['thread'] . "'");
     } else {
         $threadQuery = $mysql->query("UPDATE `threads` SET `lastpost` = `date` WHERE `id` = '" . $mData['thread'] . "'");
     }
     redirect("thread?id=" . $mData['thread'] . "");
 } else {
     if ($_GET['profilemessage']) {
         $mQuery = $mysql->query("SELECT `user`, `poster` FROM `profilemessages` WHERE `id` = '" . escape($_GET['profilemessage']) . "'");
         if ($mQuery->num_rows) {
开发者ID:andrew4699,项目名称:Lawless-Boards,代码行数:31,代码来源:deletepost.php


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