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


PHP recursiveDelete函数代码示例

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


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

示例1: deleteData

function deleteData()
{
    global $wpdb;
    delete_option('asgarosforum_options');
    delete_option('asgarosforum_db_version');
    // For site options in multisite
    delete_site_option('asgarosforum_options');
    delete_site_option('asgarosforum_db_version');
    // Delete user meta data
    delete_metadata('user', 0, 'asgarosforum_moderator', '', true);
    delete_metadata('user', 0, 'asgarosforum_banned', '', true);
    delete_metadata('user', 0, 'asgarosforum_subscription_topic', '', true);
    delete_metadata('user', 0, 'asgarosforum_subscription_forum', '', true);
    delete_metadata('user', 0, 'asgarosforum_subscription_global_topics', '', true);
    delete_metadata('user', 0, 'asgarosforum_unread_cleared', '', true);
    delete_metadata('user', 0, 'asgarosforum_unread_exclude', '', true);
    // Delete terms
    $terms = $wpdb->get_col('SELECT t.term_id FROM ' . $wpdb->terms . ' AS t INNER JOIN ' . $wpdb->term_taxonomy . ' AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy = "asgarosforum-category";');
    foreach ($terms as $term) {
        wp_delete_term($term, 'asgarosforum-category');
    }
    // Drop custom tables
    $wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}forum_forums;");
    $wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}forum_threads;");
    $wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}forum_posts;");
    // Delete uploaded files
    $upload_dir = wp_upload_dir();
    $upload_path = $upload_dir['basedir'] . '/asgarosforum/';
    recursiveDelete($upload_path);
    // Delete themes
    $theme_path = WP_CONTENT_DIR . '/themes-asgarosforum';
    recursiveDelete($theme_path);
    // Delete data which has been used in old versions of the plugin.
    delete_metadata('user', 0, 'asgarosforum_lastvisit', '', true);
}
开发者ID:Asgaros,项目名称:asgaros-forum,代码行数:35,代码来源:uninstall.php

示例2: clearThumbnail

 /**
  * @param $name
  */
 public function clearThumbnail($name)
 {
     $dir = $this->getImageThumbnailSavePath() . "/thumb__" . $name;
     if (is_dir($dir)) {
         recursiveDelete($dir);
     }
 }
开发者ID:emanuel-london,项目名称:pimcore,代码行数:10,代码来源:Image.php

示例3: recursiveDelete

function recursiveDelete($typeid)
{
    $res = sqlStatement("SELECT procedure_type_id FROM " . "procedure_type WHERE parent = '{$typeid}'");
    while ($row = sqlFetchArray($res)) {
        recursiveDelete($row['procedure_type_id']);
    }
    sqlStatement("DELETE FROM procedure_type WHERE " . "procedure_type_id = '{$typeid}'");
}
开发者ID:mindfeederllc,项目名称:openemr,代码行数:8,代码来源:types_edit.php

示例4: recursiveDelete

function recursiveDelete($id, $db)
{
    $db_conn = $db;
    $query = $db->query("select * from tbl_menu where parent = '" . $id . "' ");
    if ($query->rowCount() > 0) {
        while ($current = $query->fetch(PDO::FETCH_ASSOC)) {
            recursiveDelete($current['id'], $db_conn);
        }
    }
    $db->exec("delete from tbl_menu where id = '" . $id . "' ");
}
开发者ID:eboominathan,项目名称:simple-management-menu-php-mysql-jquery,代码行数:11,代码来源:delete.php

示例5: recursiveDelete

function recursiveDelete($str)
{
    if (is_file($str)) {
        return @unlink($str);
    } elseif (is_dir($str)) {
        $scan = glob(rtrim($str, '/') . '/*');
        foreach ($scan as $index => $path) {
            recursiveDelete($path);
        }
        return @rmdir($str);
    }
}
开发者ID:pboothe,项目名称:CART-Web-App,代码行数:12,代码来源:signout.php

示例6: recursiveDelete

/**
 * Delete a file or recursively delete a directory
 *
 * @param string $str Path to file or directory
 */
function recursiveDelete($str)
{
    //diagrafei anadromika ta pada mesa sto path
    if (is_file($str)) {
        return @unlink($str);
    } elseif (is_dir($str)) {
        $scan = glob(rtrim($str, '/') . '/*');
        foreach ($scan as $index => $path) {
            recursiveDelete($path);
        }
        return @rmdir($str);
    }
}
开发者ID:avraampiperidis,项目名称:box,代码行数:18,代码来源:deleteItem.php

示例7: recursiveDelete

/**
 * Delete a file or recursively delete a directory
 *
 * @param string $str Path to file or directory
 */
function recursiveDelete($str)
{
    if (is_file($str)) {
        return @unlink($str);
    } elseif (is_dir($str)) {
        $scan = glob(rtrim($str, '/') . '/{,.}*', GLOB_BRACE);
        foreach ($scan as $path) {
            if (!preg_match("@/\\.\\.?\$@")) {
                recursiveDelete($path);
            }
        }
        return @rmdir($str);
    }
}
开发者ID:mcenderdragon,项目名称:Icon-Craft,代码行数:19,代码来源:git_push.php

示例8: recursiveDelete

/**
 * Recursively delete a directory.
 *
 * @param string $path The directory path to delete.
 */
function recursiveDelete($path)
{
    if (is_dir($path)) {
        $directory = dir($path);
        while (false !== ($entry = $directory->read())) {
            if ($entry != '.' && $entry != '..') {
                recursiveDelete($path . '/' . $entry);
            }
        }
        rmdir($path);
    } else {
        unlink($path);
    }
}
开发者ID:c12g,项目名称:stratos-php,代码行数:19,代码来源:Bootstrap.php

示例9: verifyPGPKey

function verifyPGPKey($content, $email)
{
    global $config;
    //allow blank "keys" if this is set
    //this means that encryption for $email will be disabled by the cron if it
    // was enabled originally
    if ($config['pgpverify_allowblank'] && trim($content) == '') {
        return true;
    }
    require_once "Crypt/GPG.php";
    //try to create a random subdirectory of $config['pgpverify_tmpdir']
    do {
        $path = $config['pgpverify_tmpdir'] . '/' . uid(16);
    } while (file_exists($path));
    $result = @mkdir($path);
    if ($result === false) {
        if ($config['debug']) {
            die("Failed to create directory [" . $path . "] for PGP verification.");
        } else {
            return false;
        }
    }
    $gpg = new Crypt_GPG(array('homedir' => $path));
    //import the key to our GPG temp directory
    try {
        $gpg->importKey($content);
    } catch (Crypt_GPG_NoDataException $e) {
        //user supplied an invalid key!
        recursiveDelete($path);
        return false;
    }
    //verify the email address matches
    $keys = $gpg->getKeys();
    if (count($keys) != 1) {
        if ($config['debug']) {
            die("Error in PGP verification: key count is " . count($keys) . "!");
        } else {
            recursiveDelete($path);
            return false;
        }
    }
    $userIds = $keys[0]->getUserIds();
    if (count($userIds) != 1 || strtolower($userIds[0]->getEmail()) != strtolower($email)) {
        recursiveDelete($path);
        return false;
    }
    recursiveDelete($path);
    return true;
}
开发者ID:17Halbe,项目名称:gpg-mailgate,代码行数:49,代码来源:gpg.php

示例10: clearThumbnails

 /**
  * @return void
  */
 public function clearThumbnails($force = false)
 {
     if ($this->_dataChanged || $force) {
         // clear the thumbnail custom settings
         $this->setCustomSetting("thumbnails", null);
         // video thumbnails and image previews
         $files = glob(PIMCORE_TEMPORARY_DIRECTORY . "/video-image-cache/video_" . $this->getId() . "__*");
         if (is_array($files)) {
             foreach ($files as $file) {
                 unlink($file);
             }
         }
         recursiveDelete($this->getImageThumbnailSavePath());
         recursiveDelete($this->getVideoThumbnailSavePath());
     }
 }
开发者ID:emanuel-london,项目名称:pimcore,代码行数:19,代码来源:Video.php

示例11: moveFiles

function moveFiles($src, $dst)
{
    if (file_exists($dst)) {
        recursiveDelete($dst);
    }
    if (is_dir($src)) {
        mkdir($dst);
        $files = scandir($src);
        foreach ($files as $file) {
            if ($file != "." && $file != "..") {
                moveFiles("{$src}/{$file}", "{$dst}/{$file}");
            }
        }
    } elseif (file_exists($src)) {
        copy($src, $dst);
    }
}
开发者ID:karsanrichard,项目名称:Repo-Downloader,代码行数:17,代码来源:update-repo.php

示例12: recursiveDelete

    @fclose($fpc);
}
if (!file_exists($repertip . 'index.html')) {
    $fpb = @fopen($repertip . 'index.html', "a+");
    @fclose($fpb);
    $creafile = 1;
}
// File creation
if ($creafile == 1) {
    $fpd = @fopen($repertip . $lastaccess, "a+");
    @fclose($fpd);
}
//Debug Mode
if ($debugdaily == 1) {
    if (file_exists($repertip)) {
        recursiveDelete($repertip);
    }
    $creafile = 1;
}
if ($creafile == 1) {
    $db = JFactory::getDBO();
    $doc = JFactory::getDocument();
    // Include Style & Script to show PopUp
    $doc->addStyleSheet(JURI::Root(true) . '/modules/mod_jq-dailypop/style/css.css');
    $doc->addStyleSheet(JURI::Root(true) . '/modules/mod_jq-dailypop/style/' . $style . '/css.css');
    //Modificado para que el PopUp aparezc cuando la URL indique el error.
    $url = $_SERVER['REQUEST_URI'];
    //Obtenemos la URL de la página actual.
    $error = substr($url, -11);
    //Substraemos únicamente el index.php?e que indica el error de búsqueda.
    $arreglo = [1 => "BLA", 2 => "BNS", 3 => "BRM", 4 => "CAJ", 5 => "CCS", 6 => "CBL", 7 => "CZE", 8 => "CUM", 9 => "VIG", 10 => "GDO", 11 => "LSP", 12 => "MAR", 13 => "PMV", 14 => "MUN", 15 => "MRD", 16 => "PYH", 17 => "PZO", 18 => "SFD", 19 => "SOM", 20 => "STD", 21 => "VLN", 22 => "VLV"];
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:31,代码来源:mod_jq-dailypop.php

示例13: importZipAction

 public function importZipAction()
 {
     $success = true;
     $importId = uniqid();
     $tmpDirectory = PIMCORE_SYSTEM_TEMP_DIRECTORY . "/asset-zip-import-" . $importId;
     $zip = new ZipArchive();
     if ($zip->open($_FILES["Filedata"]["tmp_name"]) === TRUE) {
         $zip->extractTo($tmpDirectory);
         $zip->close();
     }
     $this->importFromFileSystem($tmpDirectory, $this->_getParam("parentId"));
     // cleanup
     recursiveDelete($tmpDirectory);
     $this->_helper->json(array("success" => $success));
 }
开发者ID:shanky0110,项目名称:pimcore-custom,代码行数:15,代码来源:AssetController.php

示例14: recursiveDelete

<?php

$dir = PIMCORE_DOCUMENT_ROOT . "/PIMCORE_DEPLOYMENT_DIRECTORY";
if (is_dir($dir)) {
    recursiveDelete($dir);
}
开发者ID:SeerUK,项目名称:pimcore-manual-updater,代码行数:6,代码来源:postupdate.php

示例15: tearDownAfterClass

 public static function tearDownAfterClass()
 {
     recursiveDelete('/tmp/gitlist');
 }
开发者ID:nvdnkpr,项目名称:gitlist,代码行数:4,代码来源:ClientTest.php


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