• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP w3_rmdir函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: w3_remove_old_folders

/**
 * Removes old legacy folders. User gets a note about manual removal if the function can't delete all in 20 seconds.
 */
function w3_remove_old_folders()
{
    $config_admin = w3_instance('W3_ConfigAdmin');
    $old_folders = w3_find_old_folders();
    if ($old_folders) {
        $config_admin->set('notes.remove_w3tc', true);
        $config_admin->save();
        @set_time_limit(20);
        foreach ($old_folders as $old_folder) {
            w3_rmdir($old_folder);
        }
        $config_admin->set('notes.remove_w3tc', false);
        $config_admin->save();
    }
}
开发者ID:gumbysgoo,项目名称:bestilblomster,代码行数:18,代码来源:update.php


示例2: _flush_based_on_regex

 /**
  * Flush cache based on regex
  * @param string $regex
  */
 private function _flush_based_on_regex($regex)
 {
     if (w3_is_multisite() && !w3_is_subdomain_install()) {
         $domain = w3_get_home_url();
         $parsed = parse_url($domain);
         $host = $parsed['host'];
         $path = trim($parsed['path'], '/');
         $flush_dir = W3TC_CACHE_PAGE_ENHANCED_DIR . '/' . $host . '/' . $path;
     } else {
         $flush_dir = W3TC_CACHE_PAGE_ENHANCED_DIR . '/' . w3_get_domain(w3_get_host());
     }
     $dir = @opendir($flush_dir);
     if ($dir) {
         while (($entry = @readdir($dir)) !== false) {
             if ($entry == '.' || $entry == '..') {
                 continue;
             }
             if (preg_match('/' . $regex . '/', basename($entry))) {
                 w3_rmdir($flush_dir . DIRECTORY_SEPARATOR . $entry);
             }
         }
         @closedir($dir);
     }
 }
开发者ID:marqui678,项目名称:finalchance.Panopta,代码行数:28,代码来源:Generic.php


示例3: deactivate

 /**
  * Deactivate plugin action
  *
  * @return void
  */
 function deactivate()
 {
     delete_option('w3tc_request_data');
     // keep for other blogs
     if (!$this->locked()) {
         @unlink(W3TC_BLOGNAMES_PATH);
     }
     @unlink(W3TC_CONFIG_PREVIEW_PATH);
     w3_rmdir(W3TC_TMP_DIR);
     w3_rmdir(W3TC_LOG_DIR);
     w3_rmdir(W3TC_CACHE_FILE_MINIFY_DIR);
     w3_rmdir(W3TC_CACHE_FILE_PGCACHE_DIR);
     w3_rmdir(W3TC_CACHE_FILE_DBCACHE_DIR);
     w3_rmdir(W3TC_CACHE_FILE_OBJECTCACHE_DIR);
     w3_rmdir(W3TC_CONTENT_DIR);
 }
开发者ID:nuevomediagroup,项目名称:nmg-code,代码行数:21,代码来源:TotalCacheActivation.php


示例4: w3_emptydir

/**
 * Recursive empty dir
 *
 * @param string $path
 * @param array $exclude
 * @return void
 */
function w3_emptydir($path, $exclude = array())
{
    w3_rmdir($path, $exclude, false);
}
开发者ID:niko-lgdcom,项目名称:archives,代码行数:11,代码来源:define.php


示例5: _test_cleanup

 private function _test_cleanup()
 {
     w3_rmdir(self::$test_dir);
 }
开发者ID:getupcloud,项目名称:wordpress-ex,代码行数:4,代码来源:Setup.php


示例6: action_save_options

 /**
  * Options save action
  *
  * @return void
  */
 function action_save_options()
 {
     if (!current_user_can('manage_options')) {
         wp_die(__('You do not have the rights to perform this action.', 'w3-total-cache'));
     }
     /**
      * Redirect params
      */
     $params = array();
     /**
      * Store error message regarding permalink not enabled
      */
     $redirect_permalink_error = '';
     /**
      * Read config
      * We should use new instance of WP_Config object here
      */
     $config = new W3_Config();
     $this->read_request($config);
     $config_admin = new W3_ConfigAdmin();
     $this->read_request($config_admin);
     if ($this->_page == 'w3tc_dashboard') {
         if (W3_Request::get_boolean('maxcdn')) {
             $config->set('cdn.enabled', true);
             $config->set('cdn.engine', 'maxcdn');
         }
     }
     /**
      * General tab
      */
     if ($this->_page == 'w3tc_general') {
         $file_nfs = W3_Request::get_boolean('file_nfs');
         $file_locking = W3_Request::get_boolean('file_locking');
         $config->set('pgcache.file.nfs', $file_nfs);
         $config->set('minify.file.nfs', $file_nfs);
         $config->set('dbcache.file.locking', $file_locking);
         $config->set('objectcache.file.locking', $file_locking);
         $config->set('pgcache.file.locking', $file_locking);
         $config->set('minify.file.locking', $file_locking);
         if (is_network_admin()) {
             if ($this->_config->get_boolean('common.force_master') !== $config->get_boolean('common.force_master') || !w3_force_master() && $this->_config->get_boolean('common.force_master') && $config->get_boolean('common.force_master') || w3_force_master() && !$this->_config->get_boolean('common.force_master') && !$config->get_boolean('common.force_master')) {
                 @unlink(W3TC_CACHE_BLOGMAP_FILENAME);
                 $blogmap_dir = dirname(W3TC_CACHE_BLOGMAP_FILENAME) . '/' . basename(W3TC_CACHE_BLOGMAP_FILENAME, '.php') . '/';
                 if (@is_dir($blogmap_dir)) {
                     w3_rmdir($blogmap_dir);
                 }
             }
             if ($config->get_boolean('common.force_master')) {
                 $config_admin->set('common.visible_by_master_only', true);
             }
         }
         /**
          * Check permalinks for page cache
          */
         if ($config->get_boolean('pgcache.enabled') && $config->get_string('pgcache.engine') == 'file_generic' && !get_option('permalink_structure')) {
             $config->set('pgcache.enabled', false);
             $redirect_permalink_error = 'fancy_permalinks_disabled_pgcache';
         }
         /**
          * Get New Relic application id
          */
         if ($config->get_boolean('newrelic.enabled')) {
             $method = W3_Request::get_string('application_id_method');
             $newrelic_prefix = '';
             if (w3_is_network() && w3_get_blog_id() != 0) {
                 $newrelic_prefix = $this->_config->get_string('newrelic.appname_prefix');
             }
             if (($newrelic_api_key = $config->get_string('newrelic.api_key')) && !$config->get_string('newrelic.account_id')) {
                 $nerser = w3_instance('W3_NewRelicService');
                 $account_id = $nerser->get_account_id($newrelic_api_key);
                 $config->set('newrelic.account_id', $account_id);
             }
             if ($method == 'dropdown' && $config->get_string('newrelic.application_id')) {
                 $application_id = $config->get_string('newrelic.application_id');
                 if ($config->get_string('newrelic.api_key') && $config->get_string('newrelic.account_id')) {
                     w3_require_once(W3TC_LIB_W3_DIR . '/NewRelicService.php');
                     $nerser = new W3_NewRelicService($config->get_string('newrelic.api_key'), $config->get_string('newrelic.account_id'));
                     $appname = $nerser->get_application_name($application_id);
                     $config->set('newrelic.appname', $appname);
                 }
             } else {
                 if ($method == 'manual' && $config->get_string('newrelic.appname')) {
                     if ($newrelic_prefix != '' && strpos($config->get_string('newrelic.appname'), $newrelic_prefix) === false) {
                         $application_name = $newrelic_prefix . $config->get_string('newrelic.appname');
                         $config->set('newrelic.appname', $application_name);
                     } else {
                         $application_name = $config->get_string('newrelic.appname');
                     }
                     if ($config->get_string('newrelic.api_key') && $config->get_string('newrelic.account_id')) {
                         w3_require_once(W3TC_LIB_W3_DIR . '/NewRelicService.php');
                         $nerser = new W3_NewRelicService($config->get_string('newrelic.api_key'), $config->get_string('newrelic.account_id'));
                         $application_id = $nerser->get_application_id($application_name);
                         if ($application_id) {
                             $config->set('newrelic.application_id', $application_id);
                         }
//.........这里部分代码省略.........
开发者ID:yszar,项目名称:linuxwp,代码行数:101,代码来源:DefaultActionsAdmin.php


示例7: action_save_options

 /**
  * Options save action
  *
  * @return void
  */
 function action_save_options()
 {
     /**
      * Redirect params
      */
     $params = array();
     /**
      * Store error message regarding permalink not enabled
      */
     $redirect_permalink_error = '';
     /**
      * Read config
      * We should use new instance of WP_Config object here
      */
     $config = new W3_Config();
     if (!$this->_config->own_config_exists()) {
         $config->import_legacy_config();
     }
     $this->read_request($config);
     $config_admin = new W3_ConfigAdmin();
     $this->read_request($config_admin);
     if ($this->_page == 'w3tc_dashboard') {
         if (W3_Request::get_boolean('maxcdn')) {
             $config->set('cdn.enabled', true);
             $config->set('cdn.engine', 'maxcdn');
         }
     }
     /**
      * General tab
      */
     if ($this->_page == 'w3tc_general') {
         $file_nfs = W3_Request::get_boolean('file_nfs');
         $file_locking = W3_Request::get_boolean('file_locking');
         $config->set('pgcache.file.nfs', $file_nfs);
         $config->set('minify.file.nfs', $file_nfs);
         $config->set('dbcache.file.locking', $file_locking);
         $config->set('objectcache.file.locking', $file_locking);
         $config->set('pgcache.file.locking', $file_locking);
         $config->set('minify.file.locking', $file_locking);
         if ($this->is_network_and_master()) {
             if ($this->_config->get_boolean('common.force_master') !== $config->get_boolean('common.force_master') || !w3_force_master() && $this->_config->get_boolean('common.force_master') && $config->get_boolean('common.force_master') || w3_force_master() && !$this->_config->get_boolean('common.force_master') && !$config->get_boolean('common.force_master')) {
                 @unlink(W3TC_CACHE_BLOGMAP_FILENAME);
                 $blogmap_dir = dirname(W3TC_CACHE_BLOGMAP_FILENAME) . '/' . basename(W3TC_CACHE_BLOGMAP_FILENAME, '.php') . '/';
                 if (@is_dir($blogmap_dir)) {
                     w3_rmdir($blogmap_dir);
                 }
             }
             if ($config->get_boolean('common.force_master')) {
                 $config_admin->set('common.visible_by_master_only', true);
             }
         }
         /**
          * Check permalinks for page cache
          */
         if ($config->get_boolean('pgcache.enabled') && $config->get_string('pgcache.engine') == 'file_generic' && !get_option('permalink_structure')) {
             $config->set('pgcache.enabled', false);
             $redirect_permalink_error = 'fancy_permalinks_disabled_pgcache';
         }
         $w3_cloudflare = w3_instance('W3_CloudFlare');
         $w3_cloudflare->reset_settings_cache();
         if ($config->get_boolean('cloudflare.enabled') && $w3_cloudflare->minify_enabled() && $config->get_boolean('minify.enabled')) {
             $config->set('minify.enabled', false);
         }
         /**
          * Get New Relic application id
          */
         if ($config->get_boolean('newrelic.enabled')) {
             $method = W3_Request::get_string('application_id_method');
             $newrelic_prefix = '';
             if (w3_is_network() && w3_get_blog_id() != 0) {
                 $newrelic_prefix = $this->_config->get_string('newrelic.appname_prefix');
             }
             if (($newrelic_api_key = $config->get_string('newrelic.api_key')) && !$config->get_string('newrelic.account_id')) {
                 $nerser = w3_instance('W3_NewRelicService');
                 $account_id = $nerser->get_account_id($newrelic_api_key);
                 $config->set('newrelic.account_id', $account_id);
             }
             if ($method == 'dropdown' && $config->get_string('newrelic.application_id')) {
                 $application_id = $config->get_string('newrelic.application_id');
                 if ($config->get_string('newrelic.api_key') && $config->get_string('newrelic.account_id')) {
                     w3_require_once(W3TC_LIB_W3_DIR . '/NewRelicService.php');
                     $nerser = new W3_NewRelicService($config->get_string('newrelic.api_key'), $config->get_string('newrelic.account_id'));
                     $appname = $nerser->get_application_name($application_id);
                     $config->set('newrelic.appname', $appname);
                 }
             } else {
                 if ($method == 'manual' && $config->get_string('newrelic.appname')) {
                     if ($newrelic_prefix != '' && strpos($config->get_string('newrelic.appname'), $newrelic_prefix) === false) {
                         $application_name = $newrelic_prefix . $config->get_string('newrelic.appname');
                         $config->set('newrelic.appname', $application_name);
                     } else {
                         $application_name = $config->get_string('newrelic.appname');
                     }
                     if ($config->get_string('newrelic.api_key') && $config->get_string('newrelic.account_id')) {
                         w3_require_once(W3TC_LIB_W3_DIR . '/NewRelicService.php');
//.........这里部分代码省略.........
开发者ID:Creative-Srijon,项目名称:top10bestwp,代码行数:101,代码来源:TotalCacheAdmin.php


示例8: w3_wp_delete_folders

/**
 * @param $folders
 * @param string $method Which method to use when creating
 * @param string $url Where to redirect after creation
 * @param bool|string $context path folder where delete folders resides
 * @throws FilesystemCredentialException with S/FTP form if it can't get the required filesystem credentials
 * @throws FileOperationException
 */
function w3_wp_delete_folders($folders, $method = '', $url = '', $context = false)
{
    $delete_folders = array();
    foreach ($folders as $folder) {
        if (is_dir($folder)) {
            $delete_folders[] = $folder;
        }
    }
    if (empty($delete_folders)) {
        return;
    }
    $removed = true;
    foreach ($delete_folders as $folder) {
        w3_rmdir($folder);
        if (@is_dir($folder)) {
            @rmdir($folder);
        }
        if (@is_dir($folder)) {
            $removed = false;
            break;
        }
    }
    if ($removed) {
        return;
    }
    w3_wp_request_filesystem_credentials($method, $url, $context);
    global $wp_filesystem;
    foreach ($delete_folders as $folder) {
        w3_rmdir($folder);
        if (file_exists($folder)) {
            if (!$wp_filesystem->rmdir($folder, FS_CHMOD_DIR)) {
                throw new FileOperationException('Could not delete directory: ' . $folder, 'delete', 'folder', $folder);
            }
        }
    }
}
开发者ID:marqui678,项目名称:finalchance.Panopta,代码行数:44,代码来源:activation.php


示例9: deactivate

 /**
  * Deactivate plugin action
  * @todo Complete plugin uninstall on site wide activation
  */
 function deactivate()
 {
     $this->link_delete();
     delete_option('w3tc_request_data');
     w3_rmdir(W3TC_TMP_DIR);
     w3_rmdir(W3TC_LOG_DIR);
     w3_rmdir(W3TC_CACHE_FILE_MINIFY_DIR);
     w3_rmdir(W3TC_CACHE_FILE_PGCACHE_DIR);
     w3_rmdir(W3TC_CACHE_FILE_DBCACHE_DIR);
     w3_rmdir(W3TC_CONTENT_DIR);
 }
开发者ID:alx,项目名称:SBek-Arak,代码行数:15,代码来源:TotalCache.php


示例10: deactivate

 /**
  * Deactivate plugin action
  *
  * @return void
  */
 function deactivate()
 {
     delete_option('w3tc_request_data');
     w3_rmdir(W3TC_CACHE_DIR);
 }
开发者ID:getupcloud,项目名称:wordpress-ex,代码行数:10,代码来源:TotalCacheActivation.php


示例11: w3_wp_delete_folder

/**
 * @param $folder
 * @param string $method Which method to use when creating
 * @param string $url Where to redirect after creation
 * @param bool|string $context path folder where delete folders resides
 * @throws FilesystemRmdirException
 */
function w3_wp_delete_folder($folder)
{
    if (!@is_dir($folder)) {
        return;
    }
    w3_rmdir($folder);
    if (!@is_dir($folder)) {
        return;
    }
    try {
        w3_wp_request_filesystem_credentials();
    } catch (FilesystemOperationException $ex) {
        throw new FilesystemRmdirException($ex->getMessage(), $ex->credentials_form(), $folder);
    }
    global $wp_filesystem;
    if (!$wp_filesystem->rmdir($folder)) {
        throw new FilesystemRmdirException(__('FTP credentials don\'t allow to delete folder ', 'w3-total-cache') . '<strong>' . $folder . '</strong>', w3_get_filesystem_credentials_form(), $folder);
    }
}
开发者ID:gumbysgoo,项目名称:bestilblomster,代码行数:26,代码来源:activation.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP w3_trim_rules函数代码示例发布时间:2022-05-23
下一篇:
PHP w3_require_once函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap