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

PHP w3_get_blog_id函数代码示例

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

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



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

示例1: fix_in_wpadmin

 function fix_in_wpadmin($config, $force_all_checks = false)
 {
     $exs = new SelfTestExceptions();
     $fix_on_event = false;
     if (w3_is_multisite() && w3_get_blog_id() != 0) {
         if (get_transient('w3tc_config_changes') != ($md5_string = $config->get_md5())) {
             $fix_on_event = true;
             set_transient('w3tc_config_changes', $md5_string, 3600);
         }
     }
     // call plugin-related handlers
     foreach ($this->get_handlers($config) as $h) {
         try {
             $h->fix_on_wpadmin_request($config, $force_all_checks);
             if ($fix_on_event) {
                 $this->fix_on_event($config, 'admin_request');
             }
         } catch (SelfTestExceptions $ex) {
             $exs->push($ex);
         }
     }
     if (count($exs->exceptions()) > 0) {
         throw $exs;
     }
 }
开发者ID:gumbysgoo,项目名称:bestilblomster,代码行数:25,代码来源:AdminEnvironment.php


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


示例3: __construct

 /**
  * Constructor
  */
 function __construct()
 {
     $this->_blog_id = w3_get_blog_id();
     // defines $keys_admin with descriptors
     include W3TC_LIB_W3_DIR . '/ConfigKeys.php';
     $this->_keys = $keys_admin;
     $this->_aggregated_data_object = new W3_ConfigData($keys_admin);
     $this->_aggregated_data_object->set_defaults();
     // load master-config data
     $filename1 = $this->_get_config_filename(true);
     $this->_aggregated_data_object->read($filename1);
     // load blog-config data (or master if we are master)
     $filename2 = $this->_get_config_filename();
     $this->_data_object = new W3_ConfigData($keys_admin);
     // set defaults
     $this->_data_object->set_group($this->_aggregated_data_object->data);
     $data = W3_ConfigData::get_array_from_file($filename2);
     if (!is_null($data)) {
         foreach ($data as $key => $value) {
             if ($this->_writable_key($key)) {
                 $this->_data_object->set($key, $value);
             }
         }
     }
     // merge blog-specific config data to aggregated data
     if ($this->_blog_id > 0) {
         $this->_aggregated_data_object->set_group($this->_data_object->data);
     }
     $this->_data =& $this->_aggregated_data_object->data;
 }
开发者ID:rongandat,项目名称:sallumeh,代码行数:33,代码来源:ConfigAdmin.php


示例4: w3_run_legacy_update

/**
 * Updates the plugin from older version.
 */
function w3_run_legacy_update()
{
    w3_require_once(W3TC_LIB_W3_DIR . '/ConfigWriter.php');
    $writer = new W3_ConfigWriter(w3_get_blog_id(), w3_is_preview_mode());
    $writer->import_legacy_config_and_save();
    // Only remove folders when master blog is running.
    if (w3_get_blog_id() == 0) {
        w3_remove_old_folders();
    }
}
开发者ID:marqui678,项目名称:finalchance.Panopta,代码行数:13,代码来源:update.php


示例5: instance

 /**
  * Returns cache engine instance
  *
  * @param string $engine
  * @param array $config
  * @return W3_Cache_Base
  */
 static function instance($engine, $config = array())
 {
     static $instances = array();
     // common configuration data
     if (!isset($config['blog_id'])) {
         $config['blog_id'] = w3_get_blog_id();
     }
     $instance_key = sprintf('%s_%s', $engine, md5(serialize($config)));
     if (!isset($instances[$instance_key])) {
         switch ($engine) {
             case W3TC_CACHE_MEMCACHED:
                 w3_require_once(W3TC_LIB_W3_DIR . '/Cache/Memcached.php');
                 $instances[$instance_key] = new W3_Cache_Memcached($config);
                 break;
             case W3TC_CACHE_APC:
                 w3_require_once(W3TC_LIB_W3_DIR . '/Cache/Apc.php');
                 $instances[$instance_key] = new W3_Cache_Apc($config);
                 break;
             case W3TC_CACHE_EACCELERATOR:
                 w3_require_once(W3TC_LIB_W3_DIR . '/Cache/Eaccelerator.php');
                 $instances[$instance_key] = new W3_Cache_Eaccelerator($config);
                 break;
             case W3TC_CACHE_XCACHE:
                 w3_require_once(W3TC_LIB_W3_DIR . '/Cache/Xcache.php');
                 $instances[$instance_key] = new W3_Cache_Xcache($config);
                 break;
             case W3TC_CACHE_WINCACHE:
                 w3_require_once(W3TC_LIB_W3_DIR . '/Cache/Wincache.php');
                 $instances[$instance_key] = new W3_Cache_Wincache($config);
                 break;
             case W3TC_CACHE_FILE:
                 w3_require_once(W3TC_LIB_W3_DIR . '/Cache/File.php');
                 $instances[$instance_key] = new W3_Cache_File($config);
                 break;
             case W3TC_CACHE_FILE_GENERIC:
                 w3_require_once(W3TC_LIB_W3_DIR . '/Cache/File/Generic.php');
                 $instances[$instance_key] = new W3_Cache_File_Generic($config);
                 break;
             default:
                 trigger_error('Incorrect cache engine', E_USER_WARNING);
                 w3_require_once(W3TC_LIB_W3_DIR . '/Cache/Base.php');
                 $instances[$instance_key] = new W3_Cache_Base($config);
                 break;
         }
         if (!$instances[$instance_key]->available()) {
             w3_require_once(W3TC_LIB_W3_DIR . '/Cache/Base.php');
             $instances[$instance_key] = new W3_Cache_Base($config);
         }
     }
     return $instances[$instance_key];
 }
开发者ID:easinewe,项目名称:Avec2016,代码行数:58,代码来源:Cache.php


示例6: __construct

 /**
  * Constructor
  */
 function __construct($master = false)
 {
     $preview = w3_is_preview_mode();
     if (defined('WP_ADMIN')) {
         $config_admin = w3_instance('W3_ConfigAdmin');
         $preview = $config_admin->get_boolean('previewmode.enabled');
     }
     if ($master) {
         $this->_blog_id = 0;
     } else {
         $this->_blog_id = w3_get_blog_id();
     }
     $this->_preview = $preview;
     $this->load();
 }
开发者ID:marqui678,项目名称:finalchance.Panopta,代码行数:18,代码来源:Config.php


示例7: change_filename_length

 function change_filename_length()
 {
     try {
         w3_require_once(W3TC_LIB_W3_DIR . '/Request.php');
         $new = W3_Request::get_integer('maxlength');
         $this->_config->set('minify.auto.filename_length', $new);
         set_transient('w3tc_minify_tested_filename_length', true, 3600 * 24);
         $this->_config->save();
         w3_require_once(W3TC_LIB_MINIFY_DIR . '/Minify/Cache/File.php');
         $cache = new Minify_Cache_File(w3_cache_blog_dir('minify'), array('.htaccess', 'index.php', '*.old'), $this->_config->get_boolean('minify.file.locking'), $this->_config->get_integer('timelimit.cache_flush'), w3_get_blog_id() == 0 ? W3TC_CACHE_MINIFY_DIR : null);
         $cache->flush();
         echo 1;
     } catch (Exception $ex) {
         echo $ex->getMessage();
     }
     exit;
 }
开发者ID:rongandat,项目名称:sallumeh,代码行数:17,代码来源:MinifyAdmin.php


示例8: cleanup_local

 function cleanup_local()
 {
     $engine = $this->_config->get_string('pgcache.engine');
     switch ($engine) {
         case 'file':
             w3_require_once(W3TC_LIB_W3_DIR . '/Cache/File/Cleaner.php');
             $w3_cache_file_cleaner = new W3_Cache_File_Cleaner(array('cache_dir' => w3_cache_blog_dir('page'), 'clean_timelimit' => $this->_config->get_integer('timelimit.cache_gc')));
             $w3_cache_file_cleaner->clean();
             break;
         case 'file_generic':
             w3_require_once(W3TC_LIB_W3_DIR . '/Cache/File/Cleaner/Generic.php');
             if (w3_get_blog_id() == 0) {
                 $flush_dir = W3TC_CACHE_PAGE_ENHANCED_DIR;
             } else {
                 $flush_dir = W3TC_CACHE_PAGE_ENHANCED_DIR . '/' . w3_get_domain(w3_get_host());
             }
             $w3_cache_file_cleaner_generic = new W3_Cache_File_Cleaner_Generic(array('exclude' => array('.htaccess'), 'cache_dir' => $flush_dir, 'expire' => $this->_config->get_integer('browsercache.html.lifetime'), 'clean_timelimit' => $this->_config->get_integer('timelimit.cache_gc')));
             $w3_cache_file_cleaner_generic->clean();
             break;
     }
 }
开发者ID:novichkovv,项目名称:candoweightloss,代码行数:21,代码来源:PgCacheAdmin.php


示例9: admin_notices

 function admin_notices()
 {
     /**
      * @var $nerser W3_NewRelicService
      */
     $nerser = w3_instance('W3_NewRelicService');
     $new_relic_configured = $this->_config->get_string('newrelic.account_id') && $this->_config->get_string('newrelic.api_key');
     if (w3_get_blog_id() == 0 || !$this->_config->get_boolean('common.force_master')) {
         $new_relic_configured = $new_relic_configured && $this->_config->get_string('newrelic.application_id');
     }
     $verify_running_result = $nerser->verify_running();
     $not_running = is_array($verify_running_result);
     if ($not_running) {
         $message = '<p>' . __('New Relic is not running correctly. The plugin has detected the following issues:', 'w3-total-cache') . "</p>\n";
         $message .= "<ul class=\"w3-bullet-list\">\n";
         foreach ($verify_running_result as $cause) {
             $message .= "<li>{$cause}</li>";
         }
         $message .= "</ul>\n";
         $message .= "<p>" . sprintf(__('Please review the <a href="%s">settings</a>.', 'w3-total-cache'), network_admin_url('admin.php?page=w3tc_general#monitoring')) . "</p>";
         w3_require_once(W3TC_INC_FUNCTIONS_DIR . '/ui.php');
         w3_e_error_box($message);
     }
 }
开发者ID:gumbysgoo,项目名称:bestilblomster,代码行数:24,代码来源:NewRelicAdmin.php


示例10: _get_page_key

 /**
  * Returns page key
  *
  * @param string $request_uri
  * @param string $compression
  * @return string
  */
 function _get_page_key($request_uri, $compression)
 {
     if ($this->_config->get_string('pgcache.engine') == 'file_pgcache') {
         $request_uri = preg_replace('~\\?.*$~', '', $request_uri);
         $request_uri = str_replace('/index.php', '/', $request_uri);
         $request_uri = preg_replace('~[/\\\\]+~', '/', $request_uri);
         $request_uri = w3_realpath($request_uri);
         if (empty($request_uri)) {
             $request_uri = '/';
         }
         if (substr($request_uri, -1) == '/') {
             $request_uri .= 'index.html';
         }
         $request_uri = ltrim($request_uri, '/');
         $key = sprintf('%s/%s', $_SERVER['HTTP_HOST'], $request_uri);
         if (!empty($compression)) {
             $key .= '.' . $compression;
         }
     } else {
         $blog_id = w3_get_blog_id();
         if (empty($blog_id)) {
             $blog_id = $_SERVER['HTTP_HOST'];
         }
         $key = sprintf('w3tc_%s_page_%s', md5($blog_id), md5($request_uri));
         if (!empty($compression)) {
             $key .= '_' . $compression;
         }
     }
     return $key;
 }
开发者ID:TheReaCompany,项目名称:pooplog,代码行数:37,代码来源:PgCache.php


示例11: __construct

 /**
  * PHP5 style constructor
  */
 function __construct()
 {
     global $_wp_using_ext_object_cache;
     $this->_config = w3_instance('W3_Config');
     $this->_lifetime = $this->_config->get_integer('fragmentcache.lifetime');
     $this->_debug = $this->_config->get_boolean('fragmentcache.debug');
     $this->_caching = $_wp_using_ext_object_cache = $this->_can_cache();
     $this->_blog_id = w3_get_blog_id();
     $this->_fragmentcache = w3_instance('W3_Pro_Plugin_FragmentCache');
 }
开发者ID:novichkovv,项目名称:candoweightloss,代码行数:13,代码来源:FragmentCache.php


示例12: _get_cache

 /**
  * Returns cache object
  *
  * @return W3_Cache_Base
  */
 function _get_cache()
 {
     static $cache = array();
     if (!isset($cache[0])) {
         $engine = $this->_config->get_string('pgcache.engine');
         switch ($engine) {
             case 'memcached':
                 $engineConfig = array('servers' => $this->_config->get_array('pgcache.memcached.servers'), 'persistant' => $this->_config->get_boolean('pgcache.memcached.persistant'));
                 break;
             case 'file':
                 $engineConfig = array('section' => 'page', 'flush_parent' => w3_get_blog_id() == 0, 'locking' => $this->_config->get_boolean('pgcache.file.locking'), 'flush_timelimit' => $this->_config->get_integer('timelimit.cache_flush'));
                 break;
             case 'file_generic':
                 if (w3_get_blog_id() == 0) {
                     $flush_dir = W3TC_CACHE_PAGE_ENHANCED_DIR;
                 } else {
                     $flush_dir = W3TC_CACHE_PAGE_ENHANCED_DIR . '/' . w3_get_domain(w3_get_host());
                 }
                 $engineConfig = array('exclude' => array('.htaccess'), 'expire' => $this->_lifetime, 'cache_dir' => W3TC_CACHE_PAGE_ENHANCED_DIR, 'locking' => $this->_config->get_boolean('pgcache.file.locking'), 'flush_timelimit' => $this->_config->get_integer('timelimit.cache_flush'), 'flush_dir' => $flush_dir);
                 break;
             default:
                 $engineConfig = array();
         }
         $engineConfig['use_expired_data'] = true;
         $engineConfig['module'] = 'pgcache';
         $engineConfig['host'] = w3_get_host();
         $engineConfig['instance_id'] = w3_get_instance_id();
         w3_require_once(W3TC_LIB_W3_DIR . '/Cache.php');
         $cache[0] = W3_Cache::instance($engine, $engineConfig);
     }
     return $cache[0];
 }
开发者ID:easinewe,项目名称:Avec2016,代码行数:37,代码来源:PgCache.php


示例13: checked

                <td>
                    <input name="newrelic.include_rum" type="hidden" value="0" />
                    <input id="newrelic_include_rum" name="newrelic.include_rum" type="checkbox" value="1" <?php 
checked($this->_config->get_boolean('newrelic.include_rum'));
?>
 />
                    <p><span class="description">
                    <?php 
_e('This enables inclusion of <acronym title="Real User Monitoring">RUM</acronym> when using Page Cache together with Browser Cache gzip or when using Page Cache with Disc: Enhanced', 'w3-total-cache');
?>
                    </span>
                    </p>
                </td>
            </tr>
            <?php 
if (w3_is_network() && w3_get_blog_id() == 0) {
    ?>
            <tr>
                <th><label for="newrelic_appname_prefix"><?php 
    _e('Prefix network sites:', 'w3-total-cache');
    ?>
</label></th>
                <td><input id="newrelic_appname_prefix" name="newrelic.appname_prefix" type="text" value="<?php 
    echo esc_attr($this->_config->get_string('newrelic.appname_prefix'));
    ?>
" /></td>
            </tr>
            <tr>
                <th><label for="newrelic_merge_with_network"><?php 
    _e('Include network sites stats in network:', 'w3-total-cache');
    ?>
开发者ID:rongandat,项目名称:sallumeh,代码行数:31,代码来源:new_relic.php


示例14: _get_cache

 /**
  * Returns minify cache object
  *
  * @return object
  */
 function _get_cache()
 {
     static $cache = array();
     if (!isset($cache[0])) {
         switch ($this->_config->get_string('minify.engine')) {
             case 'memcached':
                 w3_require_once(W3TC_LIB_W3_DIR . '/Cache/Memcached.php');
                 w3_require_once(W3TC_LIB_MINIFY_DIR . '/Minify/Cache/Memcache.php');
                 $w3_cache_memcached = new W3_Cache_Memcached(array('blog_id' => w3_get_blog_id(), 'instance_id' => w3_get_instance_id(), 'host' => w3_get_host(), 'module' => 'minify', 'servers' => $this->_config->get_array('minify.memcached.servers'), 'persistant' => $this->_config->get_boolean('minify.memcached.persistant')));
                 $cache[0] = new Minify_Cache_Memcache($w3_cache_memcached, 0, w3_get_blog_id(), w3_get_instance_id());
                 break;
             case 'apc':
                 w3_require_once(W3TC_LIB_MINIFY_DIR . '/Minify/Cache/APC.php');
                 $cache[0] = new Minify_Cache_APC(0, w3_get_blog_id(), w3_get_instance_id());
                 break;
             case 'eaccelerator':
                 w3_require_once(W3TC_LIB_MINIFY_DIR . '/Minify/Cache/Eaccelerator.php');
                 $cache[0] = new Minify_Cache_Eaccelerator(0, w3_get_blog_id(), w3_get_instance_id());
                 break;
             case 'xcache':
                 w3_require_once(W3TC_LIB_MINIFY_DIR . '/Minify/Cache/XCache.php');
                 $cache[0] = new Minify_Cache_XCache(0, w3_get_blog_id(), w3_get_instance_id());
                 break;
             case 'wincache':
                 w3_require_once(W3TC_LIB_MINIFY_DIR . '/Minify/Cache/Wincache.php');
                 $cache[0] = new Minify_Cache_Wincache(0, w3_get_blog_id(), w3_get_instance_id());
                 break;
             case 'file':
             default:
                 w3_require_once(W3TC_LIB_MINIFY_DIR . '/Minify/Cache/File.php');
                 $cache[0] = new Minify_Cache_File(w3_cache_blog_dir('minify'), array('.htaccess', 'index.php', '*.old'), $this->_config->get_boolean('minify.file.locking'), $this->_config->get_integer('timelimit.cache_flush'), w3_get_blog_id() == 0 ? W3TC_CACHE_MINIFY_DIR : null);
                 break;
         }
     }
     return $cache[0];
 }
开发者ID:easinewe,项目名称:Avec2016,代码行数:41,代码来源:Minify.php


示例15: after_config_change

 /**
  * Called from admin interface after configuration is changed
  */
 function after_config_change()
 {
     $this->schedule();
     if ($this->_config->get_boolean('minify.enabled') && $this->_config->get_boolean('minify.rewrite')) {
         if (w3_can_modify_rules(w3_get_minify_rules_core_path())) {
             $this->write_rules_core();
         }
         if ($this->_config->get_string('minify.engine') == 'file') {
             if (w3_can_modify_rules(w3_get_minify_rules_cache_path())) {
                 try {
                     $this->write_rules_cache();
                 } catch (Exception $e) {
                 }
             }
         } else {
             if (w3_can_modify_rules(w3_get_minify_rules_cache_path()) && w3_get_blog_id() == 0) {
                 $this->remove_rules_cache();
             }
         }
     } else {
         if (w3_can_modify_rules(w3_get_minify_rules_core_path()) && w3_get_blog_id() == 0) {
             $this->remove_rules_core();
         }
         if (w3_can_modify_rules(w3_get_minify_rules_cache_path()) && w3_get_blog_id() == 0) {
             $this->remove_rules_cache();
         }
     }
 }
开发者ID:marqui678,项目名称:finalchance.Panopta,代码行数:31,代码来源:MinifyAdmin.php


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


示例17: __construct

 /**
  * PHP5 style constructor
  */
 function __construct()
 {
     global $_wp_using_ext_object_cache;
     $this->_config = w3_instance('W3_Config');
     $this->_lifetime = $this->_config->get_integer('objectcache.lifetime');
     $this->_debug = $this->_config->get_boolean('objectcache.debug');
     $this->_caching = $_wp_using_ext_object_cache = $this->_can_cache();
     $this->global_groups = $this->_config->get_array('objectcache.groups.global');
     $this->nonpersistent_groups = $this->_config->get_array('objectcache.groups.nonpersistent');
     $this->_blog_id = w3_get_blog_id();
 }
开发者ID:gumbysgoo,项目名称:bestilblomster,代码行数:14,代码来源:ObjectCache.php


示例18: setup

 function setup()
 {
     /**
      * @var $nerser W3_NewRelicService
      */
     $nerser = w3_instance('W3_NewRelicService');
     $config_master = new W3_Config(true);
     if ($this->_config->get_boolean('newrelic.use_php_function')) {
         if (!$config_master->get_boolean('newrelic.use_network_wide_id') && (w3_get_blog_id() == 0 || !$this->_config->get_boolean('common.force_master'))) {
             $view_application = $this->_config->get_string('newrelic.application_id', 0);
         } else {
             $appname = NewRelicWrapper::get_wordpress_appname($this->_config, $config_master, false);
             $view_application = $nerser->get_application_id($appname);
             $nerser->set_application_id($view_application);
         }
     } else {
         $view_application = $this->_config->get_string('newrelic.application_id', 0);
     }
     $this->_application_id = $view_application;
     $this->_account_id = $this->_config->get_string('newrelic.account_id', 0);
 }
开发者ID:marqui678,项目名称:finalchance.Panopta,代码行数:21,代码来源:NewRelic.php


示例19: is_sealed

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


示例20: w3_parse_path

/**
 * Parses pattransparentcdnh
 *
 * @param string $path
 * @return mixed
 */
function w3_parse_path($path)
{
    $path = str_replace(array('%BLOG_ID%', '%POST_ID%', '%BLOG_ID%', '%HOST%', '%DOMAIN%', '%BASE_PATH%'), array(isset($GLOBALS['blog_id']) ? (int) $GLOBALS['blog_id'] : 0, isset($GLOBALS['post_id']) ? (int) $GLOBALS['post_id'] : 0, w3_get_blog_id(), w3_get_host(), w3_get_domain(w3_get_host()), trim(w3_get_base_path(), '/')), $path);
    return $path;
}
开发者ID:jcastilloa,项目名称:w3tc-transparentcdn,代码行数:11,代码来源:define.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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