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


PHP w3_is_cdn_mirror函数代码示例

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


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

示例1: fix_on_event

 /**
  * Fixes environment once event occurs
  *
  * @param W3_Config $config
  * @param string $event
  * @param W3_Config|null $old_config
  * @throws SelfTestExceptions
  **/
 public function fix_on_event($config, $event, $old_config = null)
 {
     if ($config->get_boolean('cdn.enabled') && !w3_is_cdn_mirror($config->get_string('cdn.engine'))) {
         if ($old_config != null && $config->get_integer('cdn.queue.interval') != $old_config->get_integer('cdn.queue.interval')) {
             $this->unschedule_queue_process();
         }
         if (!wp_next_scheduled('w3_cdn_cron_queue_process')) {
             wp_schedule_event(current_time('timestamp'), 'w3_cdn_cron_queue_process', 'w3_cdn_cron_queue_process');
         }
     } else {
         $this->unschedule_queue_process();
     }
     if ($config->get_boolean('cdn.enabled') && $config->get_boolean('cdn.autoupload.enabled') && !w3_is_cdn_mirror($config->get_string('cdn.engine'))) {
         if ($old_config != null && $config->get_integer('cdn.autoupload.interval') != $old_config->get_integer('cdn.autoupload.interval')) {
             $this->unschedule_upload();
         }
         if (!wp_next_scheduled('w3_cdn_cron_upload')) {
             wp_schedule_event(current_time('timestamp'), 'w3_cdn_cron_upload', 'w3_cdn_cron_upload');
         }
     } else {
         $this->unschedule_upload();
     }
     $exs = new SelfTestExceptions();
     if ($config->get_boolean('cdn.enabled')) {
         try {
             $this->table_create($event == 'activate');
         } catch (Exception $ex) {
             $exs->push($ex);
         }
     }
     if (count($exs->exceptions()) > 0) {
         throw $exs;
     }
 }
开发者ID:gumbysgoo,项目名称:bestilblomster,代码行数:42,代码来源:CdnAdminEnvironment.php

示例2: schedule_upload

 /**
  * Schedule upload event
  */
 function schedule_upload()
 {
     if ($this->_config->get_boolean('cdn.enabled') && $this->_config->get_boolean('cdn.autoupload.enabled') && !w3_is_cdn_mirror($this->_config->get_string('cdn.engine'))) {
         if (!nxt_next_scheduled('w3_cdn_cron_upload')) {
             nxt_schedule_event(time(), 'w3_cdn_cron_upload', 'w3_cdn_cron_upload');
         }
     } else {
         $this->unschedule_upload();
     }
 }
开发者ID:nxtclass,项目名称:NXTClass,代码行数:13,代码来源:CdnAdmin.php

示例3: notifications

 /**
  * @param W3_Config $config
  * @param W3_ConfigAdmin|null $config_admin
  * @return array
  */
 function notifications($config, $config_admin)
 {
     w3_require_once(W3TC_LIB_W3_DIR . '/Request.php');
     $page = W3_Request::get_string('page');
     $notes = array();
     if (!w3_is_cdn_mirror($config->get_string('cdn.engine'))) {
         /**
          * Show notification after theme change
          */
         if ($config->get_boolean('notes.theme_changed')) {
             $notes[] = sprintf(__('The active theme has changed, please %s now to ensure proper operation. %s', 'w3-total-cache'), w3_button_popup(__('upload active theme files', 'w3-total-cache'), 'cdn_export', 'cdn_export_type=theme'), w3_button_hide_note(__('Hide this message', 'w3-total-cache'), 'theme_changed'));
         }
         /**
          * Show notification after WP upgrade
          */
         if ($config->get_boolean('notes.wp_upgraded')) {
             $notes[] = sprintf(__('Upgraded WordPress? Please %s files now to ensure proper operation. %s', 'w3-total-cache'), w3_button_popup('upload wp-includes', 'cdn_export', 'cdn_export_type=includes'), w3_button_hide_note(__('Hide this message', 'w3-total-cache'), 'wp_upgraded'));
         }
         /**
          * Show notification after CDN enable
          */
         if ($config->get_boolean('notes.cdn_upload') || $config->get_boolean('notes.cdn_reupload')) {
             $cdn_upload_buttons = array();
             if ($config->get_boolean('cdn.includes.enable')) {
                 $cdn_upload_buttons[] = w3_button_popup('wp-includes', 'cdn_export', 'cdn_export_type=includes');
             }
             if ($config->get_boolean('cdn.theme.enable')) {
                 $cdn_upload_buttons[] = w3_button_popup('theme files', 'cdn_export', 'cdn_export_type=theme');
             }
             if ($config->get_boolean('minify.enabled') && $config->get_boolean('cdn.minify.enable') && !$config->get_boolean('minify.auto')) {
                 $cdn_upload_buttons[] = w3_button_popup('minify files', 'cdn_export', 'cdn_export_type=minify');
             }
             if ($config->get_boolean('cdn.custom.enable')) {
                 $cdn_upload_buttons[] = w3_button_popup('custom files', 'cdn_export', 'cdn_export_type=custom');
             }
             if ($config->get_boolean('notes.cdn_upload')) {
                 $notes[] = sprintf(__('Make sure to %s and upload the %s, files to the <acronym title="Content Delivery Network">CDN</acronym> to ensure proper operation. %s', 'w3-total-cache'), w3_button_popup('export the media library', 'cdn_export_library'), implode(', ', $cdn_upload_buttons), w3_button_hide_note('Hide this message', 'cdn_upload'));
             }
             if ($config->get_boolean('notes.cdn_reupload')) {
                 $notes[] = sprintf(__('Settings that affect Browser Cache settings for files hosted by the CDN have been changed. To apply the new settings %s and %s. %s', 'w3-total-cache'), w3_button_popup(__('export the media library', 'w3-total-cache'), 'cdn_export_library'), implode(', ', $cdn_upload_buttons), w3_button_hide_note(__('Hide this message', 'w3-total-cache'), 'cdn_reupload'));
             }
         }
     }
     if (in_array($config->get_string('cdn.engine'), array('netdna', 'maxcdn')) && $config_admin->get_boolean('notes.maxcdn_whitelist_ip') && $config_admin->get_integer('track.maxcdn_authorize') == 0 && $config->get_string('cdn.' . $config->get_string('cdn.engine') . '.authorization_key')) {
         $notes[] = sprintf(__('Make sure to whitelist your servers IPs. Follow the instructions on %s. The IP for this server is %s. %s', 'w3-total-cache'), '<a href="http://support.maxcdn.com/tutorials/how-to-whitelist-your-server-ip-to-use-the-api/">MaxCDN</a>', $_SERVER['SERVER_ADDR'], w3_button_hide_note('Hide this message', 'maxcdn_whitelist_ip', '', true));
     }
     return $notes;
 }
开发者ID:easinewe,项目名称:Avec2016,代码行数:53,代码来源:CdnNotes.php

示例4: view

 /**
  * Page cache tab
  *
  * @return void
  */
 function view()
 {
     global $wp_rewrite;
     $feeds = $wp_rewrite->feeds;
     $feed_key = array_search('feed', $feeds);
     if ($feed_key !== false) {
         unset($feeds[$feed_key]);
     }
     $default_feed = get_default_feed();
     $pgcache_enabled = $this->_config->get_boolean('pgcache.enabled');
     $permalink_structure = get_option('permalink_structure');
     $varnish_enabled = $this->_config->get_boolean('varnish.enabled');
     $cdn_mirror_purge_enabled = w3_is_cdn_mirror($this->_config->get_string('cdn.engine')) && $this->_config->get_string('cdn.engine') != 'mirror' && $this->_config->get_boolean('cdncache.enabled') && w3tc_edge_mode() && w3_is_pro($this->_config) || w3_is_enterprise();
     $disable_check_domain = w3_is_multisite() && w3_force_master();
     include W3TC_INC_DIR . '/options/pgcache.php';
 }
开发者ID:easinewe,项目名称:Avec2016,代码行数:21,代码来源:PgCacheAdminView.php

示例5: view

 /**
  * CDN tab
  *
  * @return void
  */
 function view()
 {
     w3_require_once(W3TC_INC_FUNCTIONS_DIR . '/ui.php');
     $cdn_enabled = $this->_config->get_boolean('cdn.enabled');
     $cdn_engine = $this->_config->get_string('cdn.engine');
     $cdn_mirror = w3_is_cdn_mirror($cdn_engine);
     $cdn_mirror_purge_all = w3_cdn_can_purge_all($cdn_engine);
     $cdn_common = w3_instance('W3_Plugin_CdnCommon');
     $cdn = $cdn_common->get_cdn();
     $cdn_supports_header = $cdn->headers_support() == W3TC_CDN_HEADER_MIRRORING;
     $cdn_supports_full_page_mirroring = $cdn->supports_full_page_mirroring();
     $minify_enabled = $this->_config->get_boolean('minify.enabled') && $this->_config->get_boolean('minify.rewrite') && (!$this->_config->get_boolean('minify.auto') || w3_is_cdn_mirror($this->_config->get_string('cdn.engine')));
     $cookie_domain = $this->get_cookie_domain();
     $set_cookie_domain = $this->is_cookie_domain_enabled();
     // Required for Update Media Query String button
     $browsercache_enabled = $this->_config->get_boolean('browsercache.enabled');
     $browsercache_update_media_qs = $this->_config->get_boolean('browsercache.cssjs.replace') || $this->_config->get_boolean('browsercache.other.replace');
     if (in_array($cdn_engine, array('netdna', 'maxcdn'))) {
         $pull_zones = array();
         $authorization_key = $this->_config->get_string("cdn.{$cdn_engine}.authorization_key");
         $zone_id = $this->_config->get_integer("cdn.{$cdn_engine}.zone_id");
         $alias = $consumerkey = $consumersecret = '';
         if ($authorization_key) {
             $keys = explode('+', $authorization_key);
             if (sizeof($keys) == 3) {
                 list($alias, $consumerkey, $consumersecret) = $keys;
             }
         }
         $authorized = $authorization_key != '' && $alias && $consumerkey && $consumersecret;
         $have_zone = $zone_id != 0;
         if ($authorized) {
             w3_require_once(W3TC_LIB_NETDNA_DIR . '/NetDNA.php');
             try {
                 $api = new NetDNA($alias, $consumerkey, $consumersecret);
                 $pull_zones = $api->get_zones_by_url(w3_get_home_url());
             } catch (Exception $ex) {
                 w3_require_once(W3TC_INC_FUNCTIONS_DIR . '/ui.php');
                 w3_e_error_box('<p>There is an error with your CDN settings: ' . $ex->getMessage() . '</p>');
             }
         }
     }
     include W3TC_INC_DIR . '/options/cdn.php';
 }
开发者ID:easinewe,项目名称:Avec2016,代码行数:48,代码来源:CdnAdminView.php

示例6: admin_notices

 /**
  * Admin notices action
  *
  * @return void
  */
 function admin_notices()
 {
     w3_require_once(W3TC_INC_FUNCTIONS_DIR . '/admin_ui.php');
     w3_require_once(W3TC_INC_FUNCTIONS_DIR . '/admin.php');
     $cookie_domain = w3_get_cookie_domain();
     $error_messages = array('fancy_permalinks_disabled_pgcache' => sprintf(__('Fancy permalinks are disabled. Please %s it first, then re-attempt to enabling enhanced disk mode.', 'w3-total-cache'), w3_button_link('enable', 'options-permalink.php')), 'fancy_permalinks_disabled_browsercache' => sprintf(__('Fancy permalinks are disabled. Please %s it first, then re-attempt to enabling the \'Do not process 404 errors for static objects with WordPress\'.', 'w3-total-cache'), w3_button_link('enable', 'options-permalink.php')), 'support_request_type' => __('Please select request type.', 'w3-total-cache'), 'support_request_url' => __('Please enter the address of the site in the site <acronym title="Uniform Resource Locator">URL</acronym> field.', 'w3-total-cache'), 'support_request_name' => __('Please enter your name in the Name field', 'w3-total-cache'), 'support_request_email' => __('Please enter valid email address in the E-Mail field.', 'w3-total-cache'), 'support_request_phone' => __('Please enter your phone in the phone field.', 'w3-total-cache'), 'support_request_subject' => __('Please enter subject in the subject field.', 'w3-total-cache'), 'support_request_description' => __('Please describe the issue in the issue description field.', 'w3-total-cache'), 'support_request_wp_login' => __('Please enter an administrator login. Create a temporary one just for this support case if needed.', 'w3-total-cache'), 'support_request_wp_password' => __('Please enter WP Admin password, be sure it\'s spelled correctly.', 'w3-total-cache'), 'support_request_ftp_host' => __('Please enter <acronym title="Secure Shell">SSH</acronym> or <acronym title="File Transfer Protocol">FTP</acronym> host for the site.', 'w3-total-cache'), 'support_request_ftp_login' => __('Please enter <acronym title="Secure Shell">SSH</acronym> or <acronym title="File Transfer Protocol">FTP</acronym> login for the server. Create a temporary one just for this support case if needed.', 'w3-total-cache'), 'support_request_ftp_password' => __('Please enter <acronym title="Secure Shell">SSH</acronym> or <acronym title="File Transfer Protocol">FTP</acronym> password for the <acronym title="File Transfer Protocol">FTP</acronym> account.', 'w3-total-cache'), 'support_request' => __('Unable to send the support request.', 'w3-total-cache'), 'config_import_no_file' => __('Please select config file.', 'w3-total-cache'), 'config_import_upload' => __('Unable to upload config file.', 'w3-total-cache'), 'config_import_import' => __('Configuration file could not be imported.', 'w3-total-cache'), 'config_reset' => sprintf(__('Default settings could not be restored. Please run <strong>chmod 777 %s</strong> to make the configuration file write-able, then try again.', 'w3-total-cache'), W3TC_CONFIG_DIR), 'cdn_purge_attachment' => __('Unable to purge attachment.', 'w3-total-cache'), 'pgcache_purge_post' => __('Unable to purge post.', 'w3-total-cache'), 'pgcache_purge_page' => __('Unable to purge page.', 'w3-total-cache'), 'enable_cookie_domain' => sprintf(__('<strong>%swp-config.php</strong> could not be written, please edit config and add:<br /><strong style="color:#f00;">define(\'COOKIE_DOMAIN\', \'%s\');</strong> before <strong style="color:#f00;">require_once(ABSPATH . \'wp-settings.php\');</strong>.', 'w3-total-cache'), ABSPATH, addslashes($cookie_domain)), 'disable_cookie_domain' => sprintf(__('<strong>%swp-config.php</strong> could not be written, please edit config and add:<br /><strong style="color:#f00;">define(\'COOKIE_DOMAIN\', false);</strong> before <strong style="color:#f00;">require_once(ABSPATH . \'wp-settings.php\');</strong>.', 'w3-total-cache'), ABSPATH), 'cloudflare_api_request' => __('Unable to make CloudFlare API request.', 'w3-total-cache'));
     $note_messages = array('config_save' => __('Plugin configuration successfully updated.', 'w3-total-cache'), 'flush_all' => __('All caches successfully emptied.', 'w3-total-cache'), 'flush_all_except_cf' => __('All caches except CloudFlare successfully emptied.', 'w3-total-cache'), 'flush_memcached' => __('Memcached cache(s) successfully emptied.', 'w3-total-cache'), 'flush_opcode' => __('Opcode cache(s) successfully emptied.', 'w3-total-cache'), 'flush_apc_system' => __('APC system cache successfully emptied', 'w3-total-cache'), 'flush_file' => __('Disk cache(s) successfully emptied.', 'w3-total-cache'), 'flush_pgcache' => __('Page cache successfully emptied.', 'w3-total-cache'), 'flush_dbcache' => __('Database cache successfully emptied.', 'w3-total-cache'), 'flush_objectcache' => __('Object cache successfully emptied.', 'w3-total-cache'), 'flush_fragmentcache' => __('Fragment cache successfully emptied.', 'w3-total-cache'), 'flush_minify' => __('Minify cache successfully emptied.', 'w3-total-cache'), 'flush_browser_cache' => __('Media Query string has been successfully updated.', 'w3-total-cache'), 'flush_varnish' => __('Varnish servers successfully purged.', 'w3-total-cache'), 'flush_cdn' => __('CDN was successfully purged.', 'w3-total-cache'), 'support_request' => __('The support request has been successfully sent.', 'w3-total-cache'), 'config_import' => __('Settings successfully imported.', 'w3-total-cache'), 'config_reset' => __('Settings successfully restored.', 'w3-total-cache'), 'preview_enable' => __('Preview mode was successfully enabled', 'w3-total-cache'), 'preview_disable' => __('Preview mode was successfully disabled', 'w3-total-cache'), 'preview_deploy' => __('Preview settings successfully deployed. Preview mode remains enabled until it\'s disabled. Continue testing new settings or disable preview mode if done.', 'w3-total-cache'), 'cdn_purge_attachment' => __('Attachment successfully purged.', 'w3-total-cache'), 'pgcache_purge_post' => __('Post successfully purged.', 'w3-total-cache'), 'pgcache_purge_page' => __('Page successfully purged.', 'w3-total-cache'), 'new_relic_save' => __('New relic settings have been updated.', 'w3-total-cache'), 'add_in_removed' => __('The add-in has been removed.', 'w3-total-cache'));
     $errors = array();
     $notes = array();
     $environment_error_present = false;
     // print errors happened during last request execution,
     // when we decided to redirect with error message instead of
     // printing it directly (to avoid reexecution on refresh)
     $message_id = W3_Request::get_string('w3tc_message');
     if ($message_id) {
         $v = get_transient('w3tc_message.' . $message_id);
         set_transient('w3tc_message.' . $message_id, null);
         if (isset($v['errors']) && is_array($v['errors'])) {
             foreach ($v['errors'] as $error) {
                 if (isset($error_messages[$error])) {
                     $errors[] = $error_messages[$error];
                 } else {
                     $errors[] = $error;
                 }
             }
         }
         if (isset($v['notes']) && is_array($v['notes'])) {
             foreach ($v['notes'] as $note) {
                 if (isset($note_messages[$note])) {
                     $notes[] = $note_messages[$note];
                 } else {
                     $notes[] = $note;
                 }
             }
         }
     }
     /*
      * Filesystem environment fix, if needed
      */
     try {
         global $pagenow;
         if ($pagenow == 'plugins.php' || substr(W3_Request::get_string('page'), 0, 5) == 'w3tc_') {
             $environment = w3_instance('W3_AdminEnvironment');
             $environment->fix_in_wpadmin($this->_config);
             if (isset($_REQUEST['upgrade'])) {
                 $notes[] = __('Required files and directories have been automatically created', 'w3-total-cache');
             }
         }
     } catch (SelfTestExceptions $exs) {
         $r = w3_parse_selftest_exceptions($exs);
         foreach ($r['before_errors'] as $e) {
             $errors[] = $e;
         }
         if (strlen($r['required_changes']) > 0) {
             $changes_style = 'border: 1px solid black; ' . 'background: white; ' . 'margin: 10px 30px 10px 30px; ' . 'padding: 10px; display: none';
             $ftp_style = 'border: 1px solid black; background: white; ' . 'margin: 10px 30px 10px 30px; ' . 'padding: 10px; display: none';
             $ftp_form = str_replace('class="wrap"', '', $exs->credentials_form());
             $ftp_form = str_replace('<form ', '<form name="w3tc_ftp_form" ', $ftp_form);
             $ftp_form = str_replace('<fieldset>', '', $ftp_form);
             $ftp_form = str_replace('</fieldset>', '', $ftp_form);
             $ftp_form = str_replace('id="upgrade" class="button"', 'id="upgrade" class="button w3tc-button-save"', $ftp_form);
             $error = '<strong>W3 Total Cache Error:</strong> ' . 'Files and directories could not be automatically ' . 'created to complete the installation. ' . '<table>' . '<tr>' . '<td>Please execute commands manually</td>' . '<td>' . w3_button('View required changes', '', 'w3tc-show-required-changes') . '</td>' . '</tr>' . '<tr>' . '<td>or use FTP form to allow ' . '<strong>W3 Total Cache</strong> make it automatically.' . '</td>' . '<td>' . w3_button('Update via FTP', '', 'w3tc-show-ftp-form') . '</td>' . '</tr></table>' . '<div class="w3tc-required-changes" style="' . $changes_style . '">' . $r['required_changes'] . '</div>' . '<div class="w3tc-ftp-form" style="' . $ftp_style . '">' . $ftp_form . '</div>';
             $environment_error_present = true;
             $errors[] = $error;
         }
         foreach ($r['later_errors'] as $e) {
             $errors[] = $e;
         }
     }
     /**
      * CloudFlare notifications
      * @var $w3_cloudflare W3_CloudFlare
      */
     $w3_cloudflare = w3_instance('W3_CloudFlare');
     if ($error = $w3_cloudflare->check_lasterror()) {
         $this->_errors[] = $error;
     }
     w3_require_once(W3TC_LIB_W3_DIR . '/Request.php');
     $error = W3_Request::get_string('w3tc_error');
     $note = W3_Request::get_string('w3tc_note');
     /**
      * Handle messages from reqeust
      */
     if ($error == 'cloudflare_api_request' && $w3_cloudflare->get_fault_signaled()) {
         // dont complain twice on cloudflare
     } elseif (isset($error_messages[$error])) {
         $errors[] = $error_messages[$error];
     }
     if (isset($note_messages[$note])) {
         $notes[] = $note_messages[$note];
     }
     /**
      * CDN notifications
      */
     if ($this->_config->get_boolean('cdn.enabled') && !w3_is_cdn_mirror($this->_config->get_string('cdn.engine'))) {
//.........这里部分代码省略.........
开发者ID:gumbysgoo,项目名称:bestilblomster,代码行数:101,代码来源:TotalCacheAdmin.php

示例7: admin_bar_menu

 /**
  * Admin bar menu
  *
  * @return void
  */
 function admin_bar_menu()
 {
     global $wp_admin_bar;
     if (current_user_can('manage_options')) {
         /**
          * @var $modules W3_ModuleStatus
          */
         $modules = w3_instance('W3_ModuleStatus');
         $can_empty_memcache = $modules->can_empty_memcache();
         $can_empty_opcode = $modules->can_empty_opcode();
         $can_empty_file = $modules->can_empty_file();
         $can_empty_varnish = $modules->can_empty_varnish();
         $browsercache_update_media_qs = $this->_config->get_boolean('browsercache.cssjs.replace') || $this->_config->get_boolean('browsercache.other.replace');
         //$cdn_enabled = $modules->is_enabled('cdn');
         $cdn_engine = $modules->get_module_engine('cdn');
         $cdn_mirror = w3_is_cdn_mirror($cdn_engine);
         $menu_items = array(array('id' => 'w3tc', 'title' => __('Performance', 'w3-total-cache'), 'href' => admin_url('admin.php?page=w3tc_dashboard')));
         if ($modules->is_enabled('pgcache') && w3_detect_post_id() && (!defined('DOING_AJAX') || !DOING_AJAX)) {
             $menu_items[] = array('id' => 'w3tc-pgcache-purge-post', 'parent' => 'w3tc', 'title' => __('Purge From Cache', 'w3-total-cache'), 'href' => wp_nonce_url(admin_url('admin.php?page=w3tc_dashboard&amp;w3tc_flush_pgcache_purge_post&amp;post_id=' . w3_detect_post_id()), 'w3tc'));
         }
         if ($can_empty_file && ($can_empty_opcode || $can_empty_memcache)) {
             $menu_items[] = array('id' => 'w3tc-flush-file', 'parent' => 'w3tc-empty-caches', 'title' => __('Empty Disc Cache(s)', 'w3-total-cache'), 'href' => wp_nonce_url(admin_url('admin.php?page=w3tc_dashboard&amp;w3tc_flush_file'), 'w3tc'));
         }
         if ($can_empty_opcode && ($can_empty_file || $can_empty_memcache)) {
             $menu_items[] = array('id' => 'w3tc-flush-opcode', 'parent' => 'w3tc-empty-caches', 'title' => __('Empty Opcode Cache', 'w3-total-cache'), 'href' => wp_nonce_url(admin_url('admin.php?page=w3tc_dashboard&amp;w3tc_flush_opcode'), 'w3tc'));
         }
         if ($can_empty_memcache && ($can_empty_file || $can_empty_opcode)) {
             $menu_items[] = array('id' => 'w3tc-flush-memcached', 'parent' => 'w3tc-empty-caches', 'title' => __('Empty Memcached Cache(s)', 'w3-total-cache'), 'href' => wp_nonce_url(admin_url('admin.php?page=w3tc_dashboard&amp;w3tc_flush_memcached'), 'w3tc'));
         }
         if ($modules->is_enabled('browsercache') && $browsercache_update_media_qs) {
             $menu_items[] = array('id' => 'w3tc-update-media-qs', 'parent' => 'w3tc', 'title' => __('Update Media Query String', 'w3-total-cache'), 'href' => wp_nonce_url(admin_url('admin.php?page=w3tc_dashboard&amp;w3tc_flush_browser_cache'), 'w3tc'));
         }
         if ($modules->plugin_is_enabled()) {
             $menu_items[] = array('id' => 'w3tc-empty-caches', 'parent' => 'w3tc', 'title' => __('Empty All Caches', 'w3-total-cache'), 'href' => wp_nonce_url(admin_url('admin.php?page=w3tc_dashboard&amp;w3tc_flush_all'), 'w3tc'));
             $menu_items[] = array('id' => 'w3tc-modules', 'parent' => 'w3tc', 'title' => __('Empty Modules', 'w3-total-cache'));
         }
         if ($modules->is_enabled('pgcache')) {
             $menu_items[] = array('id' => 'w3tc-flush-pgcache', 'parent' => 'w3tc-modules', 'title' => __('Empty Page Cache', 'w3-total-cache'), 'href' => wp_nonce_url(admin_url('admin.php?page=w3tc_dashboard&amp;w3tc_flush_pgcache'), 'w3tc'));
         }
         if ($modules->is_enabled('minify')) {
             $menu_items[] = array('id' => 'w3tc-flush-minify', 'parent' => 'w3tc-modules', 'title' => __('Empty Minify Cache', 'w3-total-cache'), 'href' => wp_nonce_url(admin_url('admin.php?page=w3tc_dashboard&amp;w3tc_flush_minify'), 'w3tc'));
         }
         if ($modules->is_enabled('dbcache')) {
             $menu_items[] = array('id' => 'w3tc-flush-dbcache', 'parent' => 'w3tc-modules', 'title' => __('Empty Database Cache', 'w3-total-cache'), 'href' => wp_nonce_url(admin_url('admin.php?page=w3tc_dashboard&amp;w3tc_flush_dbcache'), 'w3tc'));
         }
         if ($modules->is_enabled('objectcache')) {
             $menu_items[] = array('id' => 'w3tc-flush-objectcache', 'parent' => 'w3tc-modules', 'title' => __('Empty Object Cache', 'w3-total-cache'), 'href' => wp_nonce_url(admin_url('admin.php?page=w3tc_dashboard&amp;w3tc_flush_objectcache'), 'w3tc'));
         }
         if (w3_is_pro($this->_config) || w3_is_enterprise($this->_config)) {
             if ($modules->is_enabled('fragmentcache')) {
                 $menu_items[] = array('id' => 'w3tc-flush-fragmentcache', 'parent' => 'w3tc-modules', 'title' => __('Empty Fragment Cache', 'w3-total-cache'), 'href' => wp_nonce_url(admin_url('admin.php?page=w3tc_dashboard&amp;w3tc_flush_fragmentcache'), 'w3tc'));
             }
         }
         if ($modules->is_enabled('varnish')) {
             $menu_items[] = array('id' => 'w3tc-flush-varnish', 'parent' => 'w3tc-modules', 'title' => __('Purge Varnish Cache', 'w3-total-cache'), 'href' => wp_nonce_url(admin_url('admin.php?page=w3tc_dashboard&amp;w3tc_flush_varnish'), 'w3tc'));
         }
         if ($modules->is_enabled('cdn')) {
             if (w3_can_cdn_purge($cdn_engine)) {
                 $menu_items[] = array('id' => 'w3tc-cdn-purge', 'parent' => 'w3tc', 'title' => __('Purge CDN', 'w3-total-cache'), 'href' => wp_nonce_url(admin_url('admin.php?page=w3tc_cdn&amp;w3tc_cdn_purge'), 'w3tc'), 'meta' => array('onclick' => "w3tc_popupadmin_bar(this.href); return false"));
             }
             if (w3_cdn_can_purge_all($cdn_engine)) {
                 $menu_items[] = array('id' => 'w3tc-cdn-purge-full', 'parent' => 'w3tc', 'title' => __('Purge CDN Completely', 'w3-total-cache'), 'href' => wp_nonce_url(admin_url('admin.php?page=w3tc_cdn&amp;w3tc_flush_cdn'), 'w3tc'));
             }
             if (!$cdn_mirror) {
                 $menu_items[] = array('id' => 'w3tc-cdn-queue', 'parent' => 'w3tc', 'title' => __('Unsuccessful file transfers', 'w3-total-cache'), 'href' => wp_nonce_url(admin_url('admin.php?page=w3tc_cdn&amp;w3tc_cdn_queue'), 'w3tc'), 'meta' => array('onclick' => "w3tc_popupadmin_bar(this.href); return false"));
             }
         }
         $menu_items = array_merge($menu_items, array(array('id' => 'w3tc-faq', 'parent' => 'w3tc', 'title' => __('FAQ', 'w3-total-cache'), 'href' => admin_url('admin.php?page=w3tc_faq')), array('id' => 'w3tc-support', 'parent' => 'w3tc', 'title' => __('<span style="color: red; background: none;">Support</span>', 'w3-total-cache'), 'href' => admin_url('admin.php?page=w3tc_support'))));
         foreach ($menu_items as $menu_item) {
             $wp_admin_bar->add_menu($menu_item);
         }
     }
 }
开发者ID:NerdyDillinger,项目名称:ovrride,代码行数:78,代码来源:TotalCache.php

示例8: uri_to_cdn_uri

 /**
  * Convert local uri path to CDN type specific path
  * @param $local_uri_path
  * @return string
  */
 function uri_to_cdn_uri($local_uri_path)
 {
     if (w3_is_network() && defined('DOMAIN_MAPPING') && DOMAIN_MAPPING) {
         $local_uri_path = str_replace(w3_get_site_url(), '', $local_uri_path);
     }
     $engine = $this->_config->get_string('cdn.engine');
     if (w3_is_cdn_mirror($engine)) {
         if (w3_is_network() && strpos($local_uri_path, 'files') === 0) {
             $upload_dir = wp_upload_dir();
             return ltrim($this->abspath_to_relative_path(dirname($upload_dir['basedir'])) . '/' . $local_uri_path, '/');
         }
     }
     $remote_path = $local_uri_path;
     return ltrim($remote_path, "/");
 }
开发者ID:gumbysgoo,项目名称:bestilblomster,代码行数:20,代码来源:CdnCommon.php

示例9: w3_config_save


//.........这里部分代码省略.........
            $new_config->set('notes.need_empty_pgcache', true);
        }
    }
    /**
     * Show need empty minify notification
     */
    if ($current_config->get_boolean('minify.enabled') && $new_config->get_boolean('minify.enabled') && ($new_config->get_boolean('minify.css.enable') && ($new_config->get_boolean('minify.auto') || count($new_config->get_array('minify.css.groups'))) || $new_config->get_boolean('minify.js.enable') && ($new_config->get_boolean('minify.auto') || count($new_config->get_array('minify.js.groups'))))) {
        $minify_dependencies = array_merge($browsercache_dependencies, array('minify.auto', 'minify.debug', 'minify.options', 'minify.symlinks', 'minify.css.enable', 'minify.js.enable'));
        if ($new_config->get_boolean('minify.css.enable') && ($new_config->get_boolean('minify.auto') || count($new_config->get_array('minify.css.groups')))) {
            $minify_dependencies = array_merge($minify_dependencies, array('minify.css.engine', 'minify.css.combine', 'minify.css.strip.comments', 'minify.css.strip.crlf', 'minify.css.imports', 'minify.css.groups', 'minify.yuicss.path.java', 'minify.yuicss.path.jar', 'minify.yuicss.options.line-break', 'minify.csstidy.options.remove_bslash', 'minify.csstidy.options.compress_colors', 'minify.csstidy.options.compress_font-weight', 'minify.csstidy.options.lowercase_s', 'minify.csstidy.options.optimise_shorthands', 'minify.csstidy.options.remove_last_;', 'minify.csstidy.options.case_properties', 'minify.csstidy.options.sort_properties', 'minify.csstidy.options.sort_selectors', 'minify.csstidy.options.merge_selectors', 'minify.csstidy.options.discard_invalid_properties', 'minify.csstidy.options.css_level', 'minify.csstidy.options.preserve_css', 'minify.csstidy.options.timestamp', 'minify.csstidy.options.template'));
        }
        if ($new_config->get_boolean('minify.js.enable') && ($new_config->get_boolean('minify.auto') || count($new_config->get_array('minify.js.groups')))) {
            $minify_dependencies = array_merge($minify_dependencies, array('minify.js.engine', 'minify.js.combine.header', 'minify.js.combine.body', 'minify.js.combine.footer', 'minify.js.strip.comments', 'minify.js.strip.crlf', 'minify.js.groups', 'minify.yuijs.path.java', 'minify.yuijs.path.jar', 'minify.yuijs.options.line-break', 'minify.yuijs.options.nomunge', 'minify.yuijs.options.preserve-semi', 'minify.yuijs.options.disable-optimizations', 'minify.ccjs.path.java', 'minify.ccjs.path.jar', 'minify.ccjs.options.compilation_level', 'minify.ccjs.options.formatting'));
        }
        /**
         * @var W3_ModuleStatus $modules
         */
        $modules = w3_instance('W3_ModuleStatus');
        if ($modules->is_running('cdn')) {
            $minify_dependencies = array_merge($minify_dependencies, array('cdn.engine', 'cdn.enabled'));
        } elseif ($old_config->get_boolean('cdn.enabled') && !$new_config->get_boolean('cdn.enabled')) {
            $minify_dependencies = array_merge($minify_dependencies, array('cdn.enabled'));
        }
        $old_minify_dependencies_values = array();
        $new_minify_dependencies_values = array();
        foreach ($minify_dependencies as $minify_dependency) {
            $old_minify_dependencies_values[] = $old_config->get($minify_dependency);
            $new_minify_dependencies_values[] = $new_config->get($minify_dependency);
        }
        if (serialize($old_minify_dependencies_values) != serialize($new_minify_dependencies_values)) {
            $new_config->set('notes.need_empty_minify', true);
        }
    }
    if ($new_config->get_boolean('cdn.enabled') && !w3_is_cdn_mirror($new_config->get_string('cdn.engine'))) {
        /**
         * Show notification when CDN enabled
         */
        if (!$old_config->get_boolean('cdn.enabled')) {
            $new_config->set('notes.cdn_upload', true);
        }
        /**
         * Show notification when Browser Cache settings changes
         */
        $cdn_dependencies = array('browsercache.enabled');
        if ($new_config->get_boolean('cdn.enabled')) {
            $cdn_dependencies = array('browsercache.cssjs.compression', 'browsercache.cssjs.expires', 'browsercache.cssjs.lifetime', 'browsercache.cssjs.cache.control', 'browsercache.cssjs.cache.policy', 'browsercache.cssjs.etag', 'browsercache.cssjs.w3tc', 'browsercache.html.compression', 'browsercache.html.expires', 'browsercache.html.lifetime', 'browsercache.html.cache.control', 'browsercache.html.cache.policy', 'browsercache.html.etag', 'browsercache.html.w3tc', 'browsercache.other.compression', 'browsercache.other.expires', 'browsercache.other.lifetime', 'browsercache.other.cache.control', 'browsercache.other.cache.policy', 'browsercache.other.etag', 'browsercache.other.w3tc');
        }
        $old_cdn_dependencies_values = array();
        $new_cdn_dependencies_values = array();
        foreach ($cdn_dependencies as $cdn_dependency) {
            $old_cdn_dependencies_values[] = $old_config->get($cdn_dependency);
            $new_cdn_dependencies_values[] = $new_config->get($cdn_dependency);
        }
        if (serialize($old_cdn_dependencies_values) != serialize($new_cdn_dependencies_values)) {
            $new_config->set('notes.cdn_reupload', true);
        }
    }
    /**
     * Show need empty object cache notification
     */
    if ($current_config->get_boolean('objectcache.enabled')) {
        $objectcache_dependencies = array('objectcache.groups.global', 'objectcache.groups.nonpersistent');
        $old_objectcache_dependencies_values = array();
        $new_objectcache_dependencies_values = array();
        foreach ($objectcache_dependencies as $objectcache_dependency) {
            $old_objectcache_dependencies_values[] = $old_config->get($objectcache_dependency);
开发者ID:easinewe,项目名称:Avec2016,代码行数:67,代码来源:admin.php

示例10: purge

 /**
  * Purges files from CDN
  *
  * @param array $files
  * @param boolean $queue_failed
  * @param array $results
  * @return boolean
  */
 function purge($files, $queue_failed, &$results)
 {
     /**
      * Purge varnish servers before mirror purging
      */
     if (w3_is_cdn_mirror($this->_config->get_string('cdn_engine')) && $this->_config->get_boolean('varnish.enabled')) {
         $varnish =& w3_instance('W3_Varnish');
         foreach ($files as $remote_path) {
             $varnish->purge($remote_path);
         }
     }
     /**
      * Purge CDN
      */
     $cdn =& $this->get_cdn();
     @set_time_limit($this->_config->get_integer('timelimit.cdn_purge'));
     $return = $cdn->purge($files, $results);
     if (!$return && $queue_failed) {
         foreach ($results as $result) {
             if ($result['result'] != W3TC_CDN_RESULT_OK) {
                 $this->queue_add($result['local_path'], $result['remote_path'], W3TC_CDN_COMMAND_PURGE, $result['error']);
             }
         }
     }
     return $return;
 }
开发者ID:nuevomediagroup,项目名称:nmg-code,代码行数:34,代码来源:CdnCommon.php

示例11: link_replace_callback

 /**
  * Link replace callback
  *
  * @param array $matches
  * @return string
  */
 function link_replace_callback($matches)
 {
     global $wpdb;
     static $queue = null, $reject_files = null;
     list($match, $quote, $url, , , , $path) = $matches;
     $path = ltrim($path, '/');
     /**
      * Check if URL was already replaced
      */
     if (isset($this->replaced_urls[$url])) {
         return $quote . $this->replaced_urls[$url];
     }
     /**
      * Check URL for rejected files
      */
     if ($reject_files === null) {
         $reject_files = $this->_config->get_array('cdn.reject.files');
     }
     foreach ($reject_files as $reject_file) {
         if ($reject_file != '') {
             $reject_file = w3_normalize_file($reject_file);
             $reject_file_regexp = '~^(' . $this->get_regexp_by_mask($reject_file) . ')~i';
             if (preg_match($reject_file_regexp, $path)) {
                 return $match;
             }
         }
     }
     /**
      * Don't replace URL for files that are in the CDN queue
      */
     if ($queue === null) {
         if (!w3_is_cdn_mirror($this->_config->get_string('cdn.engine'))) {
             $sql = sprintf('SELECT remote_path FROM %s', $wpdb->prefix . W3TC_CDN_TABLE_QUEUE);
             $queue = $wpdb->get_col($sql);
         } else {
             $queue = false;
         }
     }
     if ($queue && in_array($path, $queue)) {
         return $match;
     }
     /**
      * Do replacement
      */
     $cdn =& $this->_get_common()->get_cdn();
     $new_url = $cdn->format_url($path);
     if ($new_url) {
         $this->replaced_urls[$url] = $new_url;
         return $quote . $new_url;
     }
     return $match;
 }
开发者ID:pyropictures,项目名称:wordpress-plugins,代码行数:58,代码来源:Cdn.php

示例12: config_save

 /**
  * Save config action
  *
  * Do some actions on config keys update
  * Used in several places such as:
  *
  * 1. common config save
  * 2. import settings
  * 3. enable/disable preview mode
  *
  * @param W3_Config $old_config
  * @param W3_Config $new_config
  * @param boolean $preview
  * @return void
  */
 function config_save(&$old_config, &$new_config, $preview = null)
 {
     $browsercache_dependencies = array();
     if ($new_config->get_boolean('browsercache.enabled')) {
         $browsercache_dependencies = array_merge($browsercache_dependencies, array('browsercache.cssjs.replace', 'browsercache.html.replace', 'browsercache.other.replace'));
         if ($new_config->get_boolean('browsercache.cssjs.replace')) {
             $browsercache_dependencies = array_merge($browsercache_dependencies, array('browsercache.cssjs.compression', 'browsercache.cssjs.expires', 'browsercache.cssjs.lifetime', 'browsercache.cssjs.cache.control', 'browsercache.cssjs.cache.policy', 'browsercache.cssjs.etag', 'browsercache.cssjs.w3tc'));
         }
         if ($new_config->get_boolean('browsercache.html.replace')) {
             $browsercache_dependencies = array_merge($browsercache_dependencies, array('browsercache.html.compression', 'browsercache.html.expires', 'browsercache.html.lifetime', 'browsercache.html.cache.control', 'browsercache.html.cache.policy', 'browsercache.html.etag', 'browsercache.html.w3tc'));
         }
         if ($new_config->get_boolean('browsercache.other.replace')) {
             $browsercache_dependencies = array_merge($browsercache_dependencies, array('browsercache.other.compression', 'browsercache.other.expires', 'browsercache.other.lifetime', 'browsercache.other.cache.control', 'browsercache.other.cache.policy', 'browsercache.other.etag', 'browsercache.other.w3tc'));
         }
     }
     /**
      * Show need empty page cache notification
      */
     if ($new_config->get_boolean('pgcache.enabled')) {
         $pgcache_dependencies = array_merge($browsercache_dependencies, array('pgcache.debug', 'dbcache.enabled', 'objectcache.enabled', 'minify.enabled', 'cdn.enabled', 'mobile.enabled', 'referrer.enabled'));
         if ($new_config->get_boolean('dbcache.enabled')) {
             $pgcache_dependencies = array_merge($pgcache_dependencies, array('dbcache.debug'));
         }
         if ($new_config->get_boolean('objectcache.enabled')) {
             $pgcache_dependencies = array_merge($pgcache_dependencies, array('objectcache.debug'));
         }
         if ($new_config->get_boolean('minify.enabled')) {
             $pgcache_dependencies = array_merge($pgcache_dependencies, array('minify.auto', 'minify.debug', 'minify.rewrite', 'minify.html.enable', 'minify.html.engine', 'minify.html.inline.css', 'minify.html.inline.js', 'minify.html.strip.crlf', 'minify.html.comments.ignore', 'minify.css.enable', 'minify.css.groups', 'minify.js.enable', 'minify.js.groups', 'minify.htmltidy.options.clean', 'minify.htmltidy.options.hide-comments', 'minify.htmltidy.options.wrap', 'minify.reject.logged', 'minify.reject.ua', 'minify.reject.uri'));
         }
         if ($new_config->get_boolean('cdn.enabled')) {
             $pgcache_dependencies = array_merge($pgcache_dependencies, array('cdn.debug', 'cdn.engine', 'cdn.uploads.enable', 'cdn.includes.enable', 'cdn.includes.files', 'cdn.theme.enable', 'cdn.theme.files', 'cdn.minify.enable', 'cdn.custom.enable', 'cdn.custom.files', 'cdn.mirror.domain', 'cdn.mirror.ssl', 'cdn.netdna.domain', 'cdn.netdna.ssl', 'cdn.cotendo.domain', 'cdn.cotendo.ssl', 'cdn.ftp.domain', 'cdn.ftp.ssl', 'cdn.s3.cname', 'cdn.s3.ssl', 'cdn.cf.cname', 'cdn.cf.ssl', 'cdn.cf2.cname', 'cdn.cf2.ssl', 'cdn.rscf.cname', 'cdn.rscf.ssl', 'cdn.azure.cname', 'cdn.azure.ssl', 'cdn.reject.admins', 'cdn.reject.ua', 'cdn.reject.uri', 'cdn.reject.files'));
         }
         if ($new_config->get_boolean('mobile.enabled')) {
             $pgcache_dependencies = array_merge($pgcache_dependencies, array('mobile.rgroups'));
         }
         if ($new_config->get_boolean('referrer.enabled')) {
             $pgcache_dependencies = array_merge($pgcache_dependencies, array('referrer.rgroups'));
         }
         $old_pgcache_dependencies_values = array();
         $new_pgcache_dependencies_values = array();
         foreach ($pgcache_dependencies as $pgcache_dependency) {
             $old_pgcache_dependencies_values[] = $old_config->get($pgcache_dependency);
             $new_pgcache_dependencies_values[] = $new_config->get($pgcache_dependency);
         }
         if (serialize($old_pgcache_dependencies_values) != serialize($new_pgcache_dependencies_values)) {
             $new_config->set('notes.need_empty_pgcache', true);
         }
     }
     /**
      * Show need empty minify notification
      */
     if ($new_config->get_boolean('minify.enabled') && ($new_config->get_boolean('minify.css.enable') && ($new_config->get_boolean('minify.auto') || count($new_config->get_array('minify.css.groups'))) || $new_config->get_boolean('minify.js.enable') && ($new_config->get_boolean('minify.auto') || count($new_config->get_array('minify.js.groups'))))) {
         $minify_dependencies = array_merge($browsercache_dependencies, array('minify.auto', 'minify.debug', 'minify.options', 'minify.symlinks', 'minify.css.enable', 'minify.js.enable'));
         if ($new_config->get_boolean('minify.css.enable') && ($new_config->get_boolean('minify.auto') || count($new_config->get_array('minify.css.groups')))) {
             $minify_dependencies = array_merge($minify_dependencies, array('minify.css.engine', 'minify.css.combine', 'minify.css.strip.comments', 'minify.css.strip.crlf', 'minify.css.imports', 'minify.css.groups', 'minify.yuicss.path.java', 'minify.yuicss.path.jar', 'minify.yuicss.options.line-break', 'minify.csstidy.options.remove_bslash', 'minify.csstidy.options.compress_colors', 'minify.csstidy.options.compress_font-weight', 'minify.csstidy.options.lowercase_s', 'minify.csstidy.options.optimise_shorthands', 'minify.csstidy.options.remove_last_;', 'minify.csstidy.options.case_properties', 'minify.csstidy.options.sort_properties', 'minify.csstidy.options.sort_selectors', 'minify.csstidy.options.merge_selectors', 'minify.csstidy.options.discard_invalid_properties', 'minify.csstidy.options.css_level', 'minify.csstidy.options.preserve_css', 'minify.csstidy.options.timestamp', 'minify.csstidy.options.template'));
         }
         if ($new_config->get_boolean('minify.js.enable') && ($new_config->get_boolean('minify.auto') || count($new_config->get_array('minify.js.groups')))) {
             $minify_dependencies = array_merge($minify_dependencies, array('minify.js.engine', 'minify.js.combine.header', 'minify.js.combine.body', 'minify.js.combine.footer', 'minify.js.strip.comments', 'minify.js.strip.crlf', 'minify.js.groups', 'minify.yuijs.path.java', 'minify.yuijs.path.jar', 'minify.yuijs.options.line-break', 'minify.yuijs.options.nomunge', 'minify.yuijs.options.preserve-semi', 'minify.yuijs.options.disable-optimizations', 'minify.ccjs.path.java', 'minify.ccjs.path.jar', 'minify.ccjs.options.compilation_level', 'minify.ccjs.options.formatting'));
         }
         $old_minify_dependencies_values = array();
         $new_minify_dependencies_values = array();
         foreach ($minify_dependencies as $minify_dependency) {
             $old_minify_dependencies_values[] = $old_config->get($minify_dependency);
             $new_minify_dependencies_values[] = $new_config->get($minify_dependency);
         }
         if (serialize($old_minify_dependencies_values) != serialize($new_minify_dependencies_values)) {
             $new_config->set('notes.need_empty_minify', true);
         }
     }
     if ($new_config->get_boolean('cdn.enabled') && !w3_is_cdn_mirror($new_config->get_string('cdn.engine'))) {
         /**
          * Show notification when CDN enabled
          */
         if (!$old_config->get_boolean('cdn.enabled')) {
             $new_config->set('notes.cdn_upload', true);
         }
         /**
          * Show notification when Browser Cache settings changes
          */
         $cdn_dependencies = array('browsercache.enabled');
         if ($new_config->get_boolean('cdn.enabled')) {
             $cdn_dependencies = array('browsercache.cssjs.compression', 'browsercache.cssjs.expires', 'browsercache.cssjs.lifetime', 'browsercache.cssjs.cache.control', 'browsercache.cssjs.cache.policy', 'browsercache.cssjs.etag', 'browsercache.cssjs.w3tc', 'browsercache.html.compression', 'browsercache.html.expires', 'browsercache.html.lifetime', 'browsercache.html.cache.control', 'browsercache.html.cache.policy', 'browsercache.html.etag', 'browsercache.html.w3tc', 'browsercache.other.compression', 'browsercache.other.expires', 'browsercache.other.lifetime', 'browsercache.other.cache.control', 'browsercache.other.cache.policy', 'browsercache.other.etag', 'browsercache.other.w3tc');
         }
         $old_cdn_dependencies_values = array();
         $new_cdn_dependencies_values = array();
//.........这里部分代码省略.........
开发者ID:niko-lgdcom,项目名称:archives,代码行数:101,代码来源:TotalCache.php

示例13: get


//.........这里部分代码省略.........
              * Minify groups legacy support
              */
         /**
          * Minify groups legacy support
          */
         case 'minify.js.groups':
         case 'minify.css.groups':
             /**
              * Support <= 0.8.5.2 versions
              */
             if (is_array($value) && count($value)) {
                 $group = current($value);
                 if (is_array($group) && count($group)) {
                     $location = current($group);
                     if (isset($location['files'])) {
                         if (function_exists('get_theme')) {
                             $theme = get_theme(get_current_theme());
                             $theme_key = w3_get_theme_key($theme['Theme Root'], $theme['Template'], $theme['Stylesheet']);
                             $value = array($theme_key => $value);
                             return $value;
                         }
                     }
                 }
             }
             /**
              * Support <= 0.9.1.3 versions
              */
             $wp_themes = get_themes();
             foreach ($value as $theme_key => $templates) {
                 if (strlen($theme_key) == 5) {
                     break;
                 }
                 foreach ($wp_themes as $wp_theme) {
                     $wp_theme_key = w3_get_theme_key_legacy($wp_theme['Theme Root'], $wp_theme['Template'], $wp_theme['Stylesheet']);
                     if ($theme_key == $wp_theme_key) {
                         $new_theme_key = w3_get_theme_key($wp_theme['Theme Root'], $wp_theme['Template'], $wp_theme['Stylesheet']);
                         $value[$new_theme_key] = $templates;
                         unset($theme_key);
                         break;
                     }
                 }
             }
             break;
             /**
              * Disable CDN minify when PHP5 is not installed or minify is disabled
              */
         /**
          * Disable CDN minify when PHP5 is not installed or minify is disabled
          */
         case 'cdn.minify.enable':
             if (!W3TC_PHP5 || !$this->get_boolean('minify.rewrite') || $this->get_boolean('minify.auto') && !w3_is_cdn_mirror($this->get_string('cdn.engine'))) {
                 return false;
             }
             break;
             /**
              * Check CDN engines
              */
         /**
          * Check CDN engines
          */
         case 'cdn.engine':
             /**
              * Check for PHP5
              */
             if (in_array($value, array('rscf', 'azure')) && !W3TC_PHP5) {
                 return 'mirror';
             }
             /**
              * Check for CURL
              */
             if (in_array($value, array('s3', 'cf', 'cf2', 'rscf')) && !function_exists('curl_init')) {
                 return 'mirror';
             }
             /**
              * Check for FTP
              */
             if ($value == 'ftp' && !function_exists('ftp_connect')) {
                 return 'mirror';
             }
             /**
              * Check for SHA 256 functions
              */
             if ($value == 'netdna' && !function_exists('hash') && !function_exists('mhash')) {
                 return 'mirror';
             }
             break;
             /**
              * Disable no 404 wp feature when server rules are not supported
              */
         /**
          * Disable no 404 wp feature when server rules are not supported
          */
         case 'browsercache.no404wp':
             if (!w3_can_check_rules()) {
                 return false;
             }
             break;
     }
     return $value;
 }
开发者ID:nuevomediagroup,项目名称:nmg-code,代码行数:101,代码来源:Config.php

示例14: _link_replace_callback_checks

 /**
  * Link replace callback, basic checks step
  *
  * @param $match
  * @param $quote
  * @param $url
  * @param $path
  * @return null|string
  */
 function _link_replace_callback_checks($match, $quote, $url, $path)
 {
     /**
      * @var wpdb $wpdb
      */
     global $wpdb;
     static $queue = null, $reject_files = null;
     /**
      * Check if URL was already replaced
      */
     if (isset($this->replaced_urls[$url])) {
         return $quote . $this->replaced_urls[$url];
     }
     /**
      * Check URL for rejected files
      */
     if ($reject_files === null) {
         $reject_files = $this->_config->get_array('cdn.reject.files');
     }
     foreach ($reject_files as $reject_file) {
         if ($reject_file != '') {
             $reject_file = $this->_replace_folder_placeholders($reject_file);
             $reject_file = w3_normalize_file($reject_file);
             $reject_file_regexp = '~^(' . $this->get_regexp_by_mask($reject_file) . ')~i';
             if (preg_match($reject_file_regexp, $path)) {
                 return $match;
             }
         }
     }
     /**
      * Don't replace URL for files that are in the CDN queue
      */
     if ($queue === null) {
         if (!w3_is_cdn_mirror($this->_config->get_string('cdn.engine'))) {
             $sql = $wpdb->prepare('SELECT remote_path FROM ' . $wpdb->prefix . W3TC_CDN_TABLE_QUEUE . ' WHERE remote_path = %s', $path);
             $queue = $wpdb->get_var($sql);
         } else {
             $queue = false;
         }
     }
     if ($queue) {
         return $match;
     }
     return null;
 }
开发者ID:easinewe,项目名称:Avec2016,代码行数:54,代码来源:Cdn.php


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