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

PHP w3_is_network函数代码示例

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

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



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

示例1: run

 function run()
 {
     add_action('w3tc_dashboard_setup', array(&$this, 'wp_dashboard_setup'));
     add_action('w3tc_network_dashboard_setup', array(&$this, 'wp_dashboard_setup'));
     // Configure authorize and have_zone
     $this->_setup($this->_config);
     /**
      * Retry setup with main blog
      */
     if (w3_is_network() && is_network_admin() && !$this->authorized) {
         $this->_config = new W3_Config(false, 1);
         $this->_setup($this->_config);
     }
     if (w3_is_network()) {
         $conig_admin = w3_instance('W3_ConfigAdmin');
         $this->_sealed = $conig_admin->get_boolean('cdn.configuration_sealed');
     }
     if ($this->have_zone && $this->authorized && isset($_GET['page']) && strpos($_GET['page'], 'w3tc_dashboard') !== false) {
         w3_require_once(W3TC_LIB_NETDNA_DIR . '/NetDNA.php');
         w3_require_once(W3TC_LIB_NETDNA_DIR . '/NetDNAPresentation.php');
         $authorization_key = $this->_config->get_string('cdn.maxcdn.authorization_key');
         $alias = $consumerkey = $consumersecret = '';
         $keys = explode('+', $authorization_key);
         if (sizeof($keys) == 3) {
             list($alias, $consumerkey, $consumersecret) = $keys;
         }
         $this->api = new NetDNA($alias, $consumerkey, $consumersecret);
         add_action('admin_head', array(&$this, 'admin_head'));
     }
 }
开发者ID:rongandat,项目名称:sallumeh,代码行数:30,代码来源:MaxCDN.php


示例2: activate

 /**
  * Activate plugin action
  *
  * @return void
  */
 function activate($network_wide)
 {
     w3_require_once(W3TC_INC_DIR . '/functions/activation.php');
     if (w3_is_network()) {
         if ($network_wide) {
             // we are in network activation
         } else {
             if ($_GET['action'] == 'error_scrape' && strpos($_SERVER['REQUEST_URI'], '/network/') !== false) {
                 // workaround for error_scrape page called after error
                 // really we are in network activation and going to throw some error
             } else {
                 echo 'Please <a href="' . network_admin_url('plugins.php') . '">network activate</a> W3 Total Cache when using WordPress Multisite.';
                 die;
             }
         }
     }
     /**
      * Create cache folder and extension files
      */
     try {
         w3_activation_create_required_files();
         if (!$this->_config->own_config_exists()) {
             $this->_config->save();
         }
         // save admin config
         $admin_config = w3_instance('W3_ConfigAdmin');
         if (!$admin_config->own_config_exists()) {
             $admin_config->save();
         }
     } catch (Exception $e) {
         w3_activation_error_on_exception($e);
     }
     delete_option('w3tc_request_data');
     add_option('w3tc_request_data', '', null, 'no');
 }
开发者ID:getupcloud,项目名称:wordpress-ex,代码行数:40,代码来源:TotalCacheActivation.php


示例3: get_wordpress_appname

 /**
  * @param W3_Config $config
  * @param W3_Config $config_master
  * @param bool $do_merge if to merge with network main site
  * @return string
  */
 public static function get_wordpress_appname($config, $config_master, $do_merge = true)
 {
     if (w3_is_network()) {
         if ($config_master->get_boolean('newrelic.use_network_wide_id')) {
             $appname = $config_master->get_string('newrelic.appname');
         } else {
             $merge = $config->get_boolean('newrelic.merge_with_network');
             $merge_name = '';
             if ($do_merge && $merge && w3_get_blog_id() != 0) {
                 $merge_name = ';' . $config_master->get_string('newrelic.appname');
             }
             if (w3_get_blog_id() != 0 && !$config->get_boolean('common.force_master')) {
                 $appname = $config->get_string('newrelic.appname', '');
                 if (empty($appname)) {
                     $prefix = $config->get_string('newrelic.appname_prefix');
                     $appname = $prefix . trim(w3_get_home_domain() . w3_get_site_path(), '/');
                 }
             } else {
                 if (w3_get_blog_id() != 0) {
                     $prefix = $config->get_string('newrelic.appname_prefix');
                     $appname = $prefix . trim(w3_get_home_domain() . w3_get_site_path(), '/');
                 } else {
                     $appname = $config->get_string('newrelic.appname');
                 }
             }
             $appname = $appname . $merge_name;
         }
     } else {
         $appname = $config->get_string('newrelic.appname');
     }
     return $appname;
 }
开发者ID:gumbysgoo,项目名称:bestilblomster,代码行数:38,代码来源:NewRelicWrapper.php


示例4: view

 /**
  * Minify tab
  *
  * @return void
  */
 function view()
 {
     $minify_enabled = $this->_config->get_boolean('minify.enabled');
     $minify_rewrite_disabled = w3_is_network() && !$this->is_master() && !$this->_config_master->get_boolean('minify.rewrite');
     $themes = w3_get_themes();
     $templates = array();
     $current_theme = w3tc_get_current_theme_name();
     $current_theme_key = '';
     foreach ($themes as $theme_key => $theme_name) {
         if ($theme_name == $current_theme) {
             $current_theme_key = $theme_key;
         }
         $templates[$theme_key] = w3_get_theme_templates($theme_name);
     }
     $css_imports_values = array('' => 'None', 'bubble' => 'Bubble', 'process' => 'Process');
     $auto = $this->_config->get_boolean('minify.auto');
     w3_require_once(W3TC_LIB_W3_DIR . '/Request.php');
     $js_theme = W3_Request::get_string('js_theme', $current_theme_key);
     $js_groups = $this->_config->get_array('minify.js.groups');
     $css_theme = W3_Request::get_string('css_theme', $current_theme_key);
     $css_groups = $this->_config->get_array('minify.css.groups');
     $js_engine = $this->_config->get_string('minify.js.engine');
     $css_engine = $this->_config->get_string('minify.css.engine');
     $html_engine = $this->_config->get_string('minify.html.engine');
     $css_imports = $this->_config->get_string('minify.css.imports');
     // 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');
     include W3TC_INC_DIR . '/options/minify.php';
 }
开发者ID:jfbelisle,项目名称:magexpress,代码行数:35,代码来源:MinifyAdminView.php


示例5: view

 /**
  * General tab
  *
  * @return void
  */
 function view()
 {
     w3_require_once(W3TC_INC_FUNCTIONS_DIR . '/ui.php');
     global $current_user;
     $config_master = $this->_config_master;
     /**
      * @var $modules W3_ModuleStatus
      */
     $modules = w3_instance('W3_ModuleStatus');
     $pgcache_enabled = $modules->is_enabled('pgcache');
     $dbcache_enabled = $modules->is_enabled('dbcache');
     $objectcache_enabled = $modules->is_enabled('objectcache');
     $browsercache_enabled = $modules->is_enabled('browsercache');
     $minify_enabled = $modules->is_enabled('minify');
     $cdn_enabled = $modules->is_enabled('cdn');
     $varnish_enabled = $modules->is_enabled('varnish');
     $fragmentcache_enabled = $modules->is_enabled('fragmentcache');
     $enabled = $modules->plugin_is_enabled();
     $enabled_checkbox = $modules->all_modules_enabled();
     $check_rules = w3_can_check_rules();
     $check_apc = function_exists('apc_store');
     $check_eaccelerator = function_exists('eaccelerator_put');
     $check_xcache = function_exists('xcache_set');
     $check_wincache = function_exists('wincache_ucache_set');
     $check_curl = function_exists('curl_init');
     $check_memcached = class_exists('Memcache');
     $check_ftp = function_exists('ftp_connect');
     $check_tidy = class_exists('tidy');
     $disc_enhanced_enabled = !(!$check_rules || !$this->is_master() && w3_is_network() && $config_master->get_string('pgcache.engine') != 'file_generic');
     $can_empty_file = $modules->can_empty_file();
     $can_empty_varnish = $modules->can_empty_varnish();
     $cdn_mirror_purge = w3_cdn_can_purge_all($modules->get_module_engine('cdn'));
     $file_nfs = $this->_config->get_boolean('pgcache.file.nfs') || $this->_config->get_boolean('minify.file.nfs');
     $file_locking = $this->_config->get_boolean('dbcache.file.locking') || $this->_config->get_boolean('objectcache.file.locking') || $this->_config->get_boolean('pgcache.file.locking') || $this->_config->get_boolean('minify.file.locking');
     w3_require_once(W3TC_LIB_NEWRELIC_DIR . '/NewRelicWrapper.php');
     $newrelic_conf_appname = NewRelicWrapper::get_wordpress_appname($this->_config, $this->_config_master, false);
     $newrelic_applications = array();
     $nerser = w3_instance('W3_NewRelicService');
     $new_relic_installed = $nerser->module_is_enabled();
     $new_relic_running = true;
     if ($this->_config->get_boolean('newrelic.enabled')) {
         $new_relic_configured = $this->_config->get_string('newrelic.api_key') && $this->_config->get_string('newrelic.account_id');
         $newrelic_prefix = '';
         if ($new_relic_configured) {
             if (w3_is_network()) {
                 $newrelic_prefix = $this->_config->get_string('newrelic.appname_prefix');
             }
             try {
                 $newrelic_applications = $nerser->get_applications();
             } catch (Exception $ex) {
             }
             $newrelic_application = $this->_config->get_string('newrelic.application_id');
         }
     }
     $licensing_visible = (!w3_is_multisite() || is_network_admin()) && !ini_get('w3tc.license_key') && get_transient('w3tc_license_status') != 'host_valid';
     $custom_areas = apply_filters("{$this->_page}_anchors", array());
     include W3TC_INC_DIR . '/options/general.php';
 }
开发者ID:easinewe,项目名称:Avec2016,代码行数:63,代码来源:GeneralAdminView.php


示例6: run

 function run()
 {
     $appname = NewRelicWrapper::get_wordpress_appname($this->_config, new W3_Config(true));
     if ($this->_config->get_boolean('newrelic.use_php_function') || w3_is_network()) {
         $enable_xmit = $this->_config->get_boolean('newrelic.enable_xmit');
         NewRelicWrapper::set_appname($appname, '', $enable_xmit);
     }
     if (defined('DOING_CRON') && DOING_CRON) {
         $this->background_task();
     }
     add_action('init', array($this, 'init'));
 }
开发者ID:marqui678,项目名称:finalchance.Panopta,代码行数:12,代码来源:NewRelic.php


示例7: on_init

 /**
  * Register actions on init
  */
 function on_init()
 {
     do_action('w3tc_register_fragment_groups');
     $actions = $this->get_registered_actions();
     foreach ($actions as $action => $groups) {
         add_action($action, array($this, 'on_action'), 0, 0);
     }
     if (w3_is_network()) {
         $global_actions = $this->get_registered_global_actions();
         foreach ($global_actions as $action => $groups) {
             add_action($action, array($this, 'on_action_global'), 0, 0);
         }
     }
 }
开发者ID:jfbelisle,项目名称:magexpress,代码行数:17,代码来源:FragmentCache.php


示例8: activate

 /**
  * Activate plugin action
  *
  * @param bool $network_wide
  * @return void
  */
 function activate($network_wide)
 {
     w3_require_once(W3TC_INC_DIR . '/functions/activation.php');
     // decline non-network activation at WPMU
     if (w3_is_network()) {
         if ($network_wide) {
             // we are in network activation
         } else {
             if ($_GET['action'] == 'error_scrape' && strpos($_SERVER['REQUEST_URI'], '/network/') !== false) {
                 // workaround for error_scrape page called after error
                 // really we are in network activation and going to throw some error
             } else {
                 echo 'Please <a href="' . network_admin_url('plugins.php') . '">network activate</a> W3 Total Cache when using WordPress Multisite.';
                 die;
             }
         }
     }
     try {
         $e = w3_instance('W3_AdminEnvironment');
         /**
          * @var W3_Config $config
          */
         $config = w3_instance('W3_Config');
         $e->fix_on_event($config, 'activate');
         w3_instance('W3_AdminLinks')->link_update($config);
         // try to save config file if needed, optional thing so exceptions
         // hidden
         if (!$config->own_config_exists()) {
             try {
                 // create folders
                 $e->fix_in_wpadmin($config);
             } catch (Exception $ex) {
             }
             try {
                 $config_admin = w3_instance('W3_ConfigAdmin');
                 $config->import_legacy_config();
                 w3_require_once(W3TC_INC_FUNCTIONS_DIR . '/admin.php');
                 w3_config_save(w3_instance('W3_Config'), $config, $config_admin);
             } catch (Exception $ex) {
             }
         }
     } catch (Exception $e) {
         w3_activation_error_on_exception($e);
     }
 }
开发者ID:rongandat,项目名称:sallumeh,代码行数:51,代码来源:RootAdminActivation.php


示例9: fix_on_wpadmin_request

 public function fix_on_wpadmin_request($config, $force_all_checks)
 {
     $exs = new SelfTestExceptions();
     $this->fix_folders($config, $exs);
     /**
      * @var W3_Config $config
      */
     if ($config->get_boolean('config.check') || $force_all_checks) {
         if ($config->get_boolean('minify.enabled') && $config->get_boolean('minify.rewrite')) {
             $this->rules_core_add($config, $exs);
         } else {
             $this->rules_core_remove($exs);
         }
         if ((w3_is_apache() || w3_is_litespeed()) && w3_is_network() && !w3_is_subdomain_install()) {
             if ($config->get_boolean('minify.enabled') && $config->get_boolean('minify.rewrite')) {
                 $this->rules_wpmu_subfolder_add($config, $exs);
             } else {
                 $this->rules_wpmu_subfolder_remove($exs);
             }
         }
         if ($config->get_boolean('minify.enabled') && $config->get_string('minify.engine') == 'file') {
             $this->rules_cache_add($config, $exs);
         } else {
             $this->rules_cache_remove($exs);
         }
     }
     // if no errors so far - check if rewrite actually works
     if (count($exs->exceptions()) <= 0 || true) {
         try {
             if ($config->get_boolean('minify.enabled') && $config->get_string('minify.engine') == 'file' && $config->get_boolean('minify.debug')) {
                 $this->verify_rewrite_working();
             }
         } catch (Exception $ex) {
             $exs->push($ex);
         }
         if ($config->get_boolean('minify.enabled')) {
             $this->verify_engine_working($config, $exs);
         }
     }
     if (count($exs->exceptions()) > 0) {
         throw $exs;
     }
 }
开发者ID:novichkovv,项目名称:candoweightloss,代码行数:43,代码来源:MinifyAdminEnvironment.php


示例10: w3_get_pgcache_rules_cache_path

/**
 * Returns path of pgcache cache rules file
 * Moved to separate file to not load rule.php for each disk enhanced request
 *
 * @return string
 */
function w3_get_pgcache_rules_cache_path()
{
    switch (true) {
        case w3_is_apache():
        case w3_is_litespeed():
            if (w3_is_network()) {
                $url = w3_get_home_url();
                $match = null;
                if (preg_match('~http(s)?://(.+?)(/)?$~', $url, $match)) {
                    $home_path = $match[2];
                    return W3TC_CACHE_PAGE_ENHANCED_DIR . '/' . $home_path . '/.htaccess';
                }
            }
            return W3TC_CACHE_PAGE_ENHANCED_DIR . '/.htaccess';
        case w3_is_nginx():
            return w3_get_nginx_rules_path();
    }
    return false;
}
开发者ID:gumbysgoo,项目名称:bestilblomster,代码行数:25,代码来源:rule_cut.php


示例11: locked

 /**
  * Check if plugin is locked
  *
  * @return boolean
  */
 function locked()
 {
     static $locked = null;
     if ($locked === null) {
         if (w3_is_network() && function_exists('get_blog_list')) {
             global $blog_id;
             $blogs = get_blog_list();
             foreach ($blogs as $blog) {
                 if ($blog['blog_id'] != $blog_id) {
                     $active_plugins = get_blog_option($blog['blog_id'], 'active_plugins');
                     if (in_array(W3TC_FILE, $active_plugins)) {
                         $locked = true;
                         break;
                     }
                 }
             }
         } else {
             $locked = false;
         }
     }
     return $locked;
 }
开发者ID:niko-lgdcom,项目名称:archives,代码行数:27,代码来源:Plugin.php


示例12: is_sealed

 /**
  * Returns true if config section is sealed
  * @param string $section
  * @return boolean
  */
 protected function is_sealed($section)
 {
     if ($this->is_master()) {
         return false;
     }
     if (w3_is_network() && !$this->is_master() && w3_force_master()) {
         return true;
     }
     // browsercache settings change rules, so not available in child settings
     if ($section == 'browsercache') {
         return true;
     }
     if ($section == 'minify' && !$this->_config_master->get_boolean('minify.enabled')) {
         return true;
     }
     return $this->_config_admin->get_boolean($section . '.configuration_sealed');
 }
开发者ID:easinewe,项目名称:Avec2016,代码行数:22,代码来源:PluginView.php


示例13: set_appname

 public function set_appname()
 {
     static $appname_set;
     if (!$appname_set && ($this->_config->get_boolean('newrelic.use_php_function') || w3_is_network())) {
         $appname_set = true;
         $appname = NewRelicWrapper::get_wordpress_appname($this->_config, new W3_Config(true));
         $enable_xmit = $this->_config->get_boolean('newrelic.enable_xmit');
         NewRelicWrapper::set_appname($appname, '', $enable_xmit);
     }
 }
开发者ID:gumbysgoo,项目名称:bestilblomster,代码行数:10,代码来源:NewRelic.php


示例14: 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


示例15: try_create_wp_loader

 /**
  * @throws TryException
  * @throws W3TCErrorException
  * @return bool
  */
 public function try_create_wp_loader()
 {
     $file_data = $this->w3tc_loader_file_data();
     $filename = $file_data['filename'];
     $data = $file_data['data'];
     w3_require_once(W3TC_INC_DIR . '/functions/rule.php');
     if (($current_data = @file_get_contents($filename)) && strstr(w3_clean_rules($current_data), w3_clean_rules($data)) !== false) {
         return true;
     }
     $url = w3_is_network() ? network_admin_url('admin.php?page=w3tc_general') : admin_url('admin.php?page=w3tc_general');
     try {
         w3_require_once(W3TC_INC_DIR . '/functions/activation.php');
         $result = w3_wp_write_to_file($filename, $data, $url);
     } catch (Exception $ex) {
         if ($ex instanceof FilesystemCredentialException) {
             throw new TryException('Could not create file', array($filename), $ex->ftp_form());
         } else {
             throw new W3TCErrorException(sprintf('<strong>W3 Total Cache Error:</strong>Could not create file <strong>%s</strong>
                 with content: <pre>%s</pre><br />You need to do this manually.', $filename, esc_textarea($data)));
         }
     }
     return true;
 }
开发者ID:getupcloud,项目名称:wordpress-ex,代码行数:28,代码来源:Setup.php


示例16: import_legacy_config_and_save

 /**
  * Overloads the current ConfigWriter with found legacy values and saves to config file.
  */
 public function import_legacy_config_and_save()
 {
     if ($this->own_config_exists()) {
         return;
     }
     /**
      * defines $keys with descriptors
      * @var array $keys config keys
      */
     include W3TC_LIB_W3_DIR . '/ConfigKeys.php';
     $compiled_config = new W3_ConfigData($keys);
     $compiled_config->set_defaults();
     $config_admin = w3_instance('W3_ConfigAdmin');
     $data = $this->_import_legacy_config($compiled_config);
     if (!is_null($data)) {
         $master_data = array();
         if ($this->_blog_id != 0 && w3_is_network()) {
             $master_config = new W3_ConfigData($keys);
             $master_config->read($this->_get_config_filename(true));
             $master_data = $master_config->data;
         }
         foreach ($data as $key => $value) {
             if ($master_data && isset($master_data[$key]) && $master_data[$key] === $value) {
                 continue;
             }
             if (!$this->_key_sealed($key, $this->_data->data, $config_admin, $value)) {
                 $this->_data->set($key, $value);
             }
         }
         // Since configs don't exist create them.
         $this->save();
         $config_admin->save();
     }
 }
开发者ID:marqui678,项目名称:finalchance.Panopta,代码行数:37,代码来源:ConfigWriter.php


示例17: foreach

            <td>
                <ul>
                    <?php 
foreach ($registered_groups as $group => $descriptor) {
    echo '<li>', $group, ' (', $descriptor['expiration'], ' secs): ', implode(',', $descriptor['actions']), '</li>';
}
?>
                </ul>
                <span class="description"><?php 
_e('The groups above will be flushed upon setting changes.', 'w3-total-cache');
?>
</span>
            </td>
        </tr>
        <?php 
if (w3_is_network()) {
    ?>
            <tr>
                <th><?php 
    _e('Registered site-wide fragment groups:', 'w3-total-cache');
    ?>
</th>
                <td>
                    <ul>
                        <?php 
    foreach ($registered_global_groups as $group => $descriptor) {
        echo '<li>', $group, ' (', $descriptor['expiration'], ' secs): ', implode(',', $descriptor['actions']), '</li>';
    }
    ?>
                    </ul>
                    <span class="description"><?php 
开发者ID:rongandat,项目名称:sallumeh,代码行数:31,代码来源:fragmentcache.php


示例18: _minify_path_replacements

 /**
  * Paths used to minify minifyfile paths
  * @return array
  */
 private function _minify_path_replacements()
 {
     if (w3_is_network()) {
         $theme = get_theme_root();
     } else {
         $theme = get_stylesheet_directory();
     }
     return array(ltrim(str_replace(w3_get_document_root(), '', w3_path($theme)), '/'), ltrim(str_replace(w3_get_document_root(), '', w3_path(WP_PLUGIN_DIR)), '/'), ltrim(str_replace(w3_get_document_root(), '', w3_path(WPMU_PLUGIN_DIR)), '/'), WPINC . '/js/jquery', WPINC . '/js', WPINC . '/css', WPINC);
 }
开发者ID:Creative-Srijon,项目名称:top10bestwp,代码行数:13,代码来源:Minify.php


示例19: w3_config_save


//.........这里部分代码省略.........
         * 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);
            $new_objectcache_dependencies_values[] = $new_config->get($objectcache_dependency);
        }
        if (serialize($old_objectcache_dependencies_values) != serialize($new_objectcache_dependencies_values)) {
            $new_config->set('notes.need_empty_objectcache', true);
        }
    }
    if ($current_config->get_boolean('newrelic.enabled')) {
        if ($current_config->get_boolean('pgcache.enabled')) {
            if (w3_is_network() && $current_config->get_boolean('common.force_master')) {
                $new_config->set('pgcache.late_init', true);
            }
        }
    }
    do_action('w3tc_saved_options', $new_config, $new_config_admin);
    /**
     * Save config
     */
    try {
        $new_config_admin->save();
        $new_config->save();
    } catch (Exception $ex) {
        // try to fix environment, it potentially can be fixed silently
        // dont show error here, it will be called again later
        // in admin_notices
        try {
            $environment = w3_instance('W3_AdminEnvironment');
            $environment->fix_in_wpadmin($new_config);
        } catch (Exception $ex) {
        }
        // retry save process and complain now on failure
        try {
            $new_config_admin->save();
            $new_config->save();
        } catch (Exception $ex) {
            throw new Exception('<strong>Can\'t change configuration</strong>: ' . $ex->getMessage());
        }
    }
    $w3_plugin_cdn = w3_instance('W3_Plugin_CdnAdmin');
    /**
     * Empty caches on engine change or cache enable/disable
     */
开发者ID:easinewe,项目名称:Avec2016,代码行数:67,代码来源:admin.php


示例20: view

 /**
  * General tab
  *
  * @return void
  */
 function view()
 {
     global $current_user;
     $config_master = $this->_config_master;
     /**
      * @var $modules W3_ModuleStatus
      */
     $modules = w3_instance('W3_ModuleStatus');
     $pgcache_enabled = $modules->is_enabled('pgcache');
     $dbcache_enabled = $modules->is_enabled('dbcache');
     $objectcache_enabled = $modules->is_enabled('objectcache');
     $browsercache_enabled = $modules->is_enabled('browsercache');
     $minify_enabled = $modules->is_enabled('minify');
     $cdn_enabled = $modules->is_enabled('cdn');
     $cloudflare_enabled = $modules->is_enabled('cloudflare');
     $varnish_enabled = $modules->is_enabled('varnish');
     $fragmentcache_enabled = $modules->is_enabled('fragmentcache');
     $enabled = $modules->plugin_is_enabled();
     $enabled_checkbox = $modules->all_modules_enabled();
     $check_rules = w3_can_check_rules();
     $check_apc = function_exists('apc_store');
     $check_eaccelerator = function_exists('eaccelerator_put');
     $check_xcache = function_exists('xcache_set');
     $check_wincache = function_exists('wincache_ucache_set');
     $check_curl = function_exists('curl_init');
     $check_memcached = class_exists('Memcache');
     $check_ftp = function_exists('ftp_connect');
     $check_tidy = class_exists('tidy');
     $disc_enhanced_enabled = !(!$check_rules || !$this->is_master() && w3_is_network() && $config_master->get_string('pgcache.engine') != 'file_generic');
     $can_empty_file = $modules->can_empty_file();
     $can_empty_varnish = $modules->can_empty_varnish();
     $cdn_mirror_purge = w3_cdn_can_purge_all($modules->get_module_engine('cdn'));
     $cloudflare_signup_email = '';
     $cloudflare_signup_user = '';
     if (is_a($current_user, 'WP_User')) {
         if ($current_user->user_email) {
             $cloudflare_signup_email = $current_user->user_email;
         }
         if ($current_user->user_login && $current_user->user_login != 'admin') {
             $cloudflare_signup_user = $current_user->user_login;
         }
     }
     /**
      * @var $w3_cloudflare W3_CloudFlare
      */
     $w3_cloudflare = w3_instance('W3_CloudFlare');
     $cf_options = $w3_cloudflare->get_options();
     $cloudflare_seclvls = $cf_options['sec_lvl'];
     $cloudflare_devmodes = $cf_options['dev_mode'];
     $cloudflare_rocket_loaders = $cf_options['async'];
     $cloudflare_minifications = $cf_options['minify'];
     $cloudflare_seclvl = 'med';
     $cloudflare_devmode_expire = 0;
     $cloudflare_devmode = 0;
     $cloudflare_rocket_loader = 0;
     $cloudflare_minify = 0;
     if ($cloudflare_enabled && $this->_config->get_string('cloudflare.email') && $this->_config->get_string('cloudflare.key')) {
         $settings = $w3_cloudflare->get_settings();
         $cloudflare_seclvl = $settings['sec_lvl'];
         $cloudflare_devmode_expire = $settings['devmode'];
         $cloudflare_rocket_loader = $settings['async'];
         $cloudflare_devmode = $cloudflare_devmode_expire ? 1 : 0;
         $cloudflare_minify = $settings['minify'];
         $can_empty_cloudflare = true;
     } else {
         $can_empty_cloudflare = false;
     }
     $file_nfs = $this->_config->get_boolean('pgcache.file.nfs') || $this->_config->get_boolean('minify.file.nfs');
     $file_locking = $this->_config->get_boolean('dbcache.file.locking') || $this->_config->get_boolean('objectcache.file.locking') || $this->_config->get_boolean('pgcache.file.locking') || $this->_config->get_boolean('minify.file.locking');
     w3_require_once(W3TC_LIB_NEWRELIC_DIR . '/NewRelicWrapper.php');
     $newrelic_conf_appname = NewRelicWrapper::get_wordpress_appname($this->_config, $this->_config_master, false);
     $newrelic_applications = array();
     $nerser = w3_instance('W3_NewRelicService');
     $new_relic_installed = $nerser->module_is_enabled();
     $new_relic_running = true;
     if ($this->_config->get_boolean('newrelic.enabled')) {
         $new_relic_configured = $this->_config->get_string('newrelic.api_key') && $this->_config->get_string('newrelic.account_id');
         $newrelic_prefix = '';
         if ($new_relic_configured) {
             if (w3_is_network()) {
                 $newrelic_prefix = $this->_config->get_string('newrelic.appname_prefix');
             }
             try {
                 $newrelic_applications = $nerser->get_applications();
             } catch (Exception $ex) {
             }
             $newrelic_application = $this->_config->get_string('newrelic.application_id');
         }
     }
     $licensing_visible = (!w3_is_multisite() || is_network_admin()) && !ini_get('w3tc.license_key') && get_transient('w3tc_license_status') != 'host_valid';
     include W3TC_INC_DIR . '/options/general.php';
 }
开发者ID:gumbysgoo,项目名称:bestilblomster,代码行数:97,代码来源:GeneralAdminView.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP w3_is_nginx函数代码示例发布时间:2022-05-23
下一篇:
PHP w3_is_multisite函数代码示例发布时间: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