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

PHP w3_force_master函数代码示例

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

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



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

示例1: generate

 function generate()
 {
     $pages = $this->generate_menu_array();
     add_menu_page(__('Performance', 'w3-total-cache'), __('Performance', 'w3-total-cache'), 'manage_options', 'w3tc_dashboard', '', 'div');
     $submenu_pages = array();
     foreach ($pages as $slug => $titles) {
         if ($this->_config_admin->get_boolean('common.visible_by_master_only') && $titles['network_show'] || (!$this->_config_admin->get_boolean('common.visible_by_master_only') || is_super_admin() && (!w3_force_master() || is_network_admin()))) {
             $submenu_pages[] = add_submenu_page('w3tc_dashboard', $titles[0] . ' | W3 Total Cache', $titles[1], 'manage_options', $slug, array(&$this, 'options'));
         }
     }
     return $submenu_pages;
 }
开发者ID:easinewe,项目名称:Avec2016,代码行数:12,代码来源:Menus.php


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


示例3: print_script

    function print_script()
    {
        ?>
        <script type="text/javascript">
            var w3_use_network_link = <?php 
        echo is_network_admin() || w3_is_multisite() && w3_force_master() ? 'true' : 'false';
        ?>
;
            function w3tc_start_minify_try_solve() {
                var testUrl = '<?php 
        echo w3_filename_to_url(w3_cache_blog_dir('minify') . '/', w3_get_domain(w3_get_home_url()) != w3_get_domain(w3_get_site_url()));
        ?>
';
                w3tc_filename_auto_solve(testUrl);
            }
        </script>
        <?php 
    }
开发者ID:easinewe,项目名称:Avec2016,代码行数:18,代码来源:MinifyAdmin.php


示例4: print_script

    function print_script()
    {
        ?>
        <script type="text/javascript">
            var w3_use_network_link = <?php 
        echo w3_force_master() ? 'true' : 'false';
        ?>
;
            function w3tc_start_minify_try_solve() {
                var testUrl = '<?php 
        echo w3_filename_to_url(w3_cache_blog_dir('minify') . '/');
        ?>
';
                w3tc_filename_auto_solve(testUrl);
            }
        </script>
        <?php 
    }
开发者ID:gumbysgoo,项目名称:bestilblomster,代码行数:18,代码来源:MinifyAdmin.php


示例5: generate

 function generate()
 {
     $pages = array('w3tc_dashboard' => array(__('Dashboard', 'w3-total-cache'), __('Dashboard', 'w3-total-cache'), 'network_show' => true), 'w3tc_general' => array(__('General Settings', 'w3-total-cache'), __('General Settings', 'w3-total-cache'), 'network_show' => false), 'w3tc_pgcache' => array(__('Page Cache', 'w3-total-cache'), __('Page Cache', 'w3-total-cache'), 'network_show' => false), 'w3tc_minify' => array(__('Minify', 'w3-total-cache'), __('Minify', 'w3-total-cache'), 'network_show' => false), 'w3tc_dbcache' => array(__('Database Cache', 'w3-total-cache'), __('Database Cache', 'w3-total-cache'), 'network_show' => false), 'w3tc_objectcache' => array(__('Object Cache', 'w3-total-cache'), __('Object Cache', 'w3-total-cache'), 'network_show' => false));
     if (w3_is_pro($this->_config) || w3_is_enterprise($this->_config)) {
         $pages['w3tc_fragmentcache'] = array(__('Fragment Cache', 'w3-total-cache'), __('Fragment Cache', 'w3-total-cache'), 'network_show' => false);
     }
     $pages = array_merge($pages, array('w3tc_browsercache' => array(__('Browser Cache', 'w3-total-cache'), __('Browser Cache', 'w3-total-cache'), 'network_show' => false), 'w3tc_mobile' => array(__('User Agent Groups', 'w3-total-cache'), __('User Agent Groups', 'w3-total-cache'), 'network_show' => false), 'w3tc_referrer' => array(__('Referrer Groups', 'w3-total-cache'), __('Referrer Groups', 'w3-total-cache'), 'network_show' => false), 'w3tc_cdn' => array(__('Content Delivery Network', 'w3-total-cache'), __('<acronym title="Content Delivery Network">CDN</acronym>', 'w3-total-cache'), 'network_show' => $this->_config->get_boolean('cdn.enabled')), 'w3tc_monitoring' => array(__('Monitoring', 'w3-total-cache'), __('Monitoring', 'w3-total-cache'), 'network_show' => false)));
     $pages_tail = array('w3tc_faq' => array(__('FAQ', 'w3-total-cache'), __('FAQ', 'w3-total-cache'), 'network_show' => true), 'w3tc_support' => array(__('Support', 'w3-total-cache'), __('<span style="color: red;">Support</span>', 'w3-total-cache'), 'network_show' => true), 'w3tc_install' => array(__('Install', 'w3-total-cache'), __('Install', 'w3-total-cache'), 'network_show' => false), 'w3tc_about' => array(__('About', 'w3-total-cache'), __('About', 'w3-total-cache'), 'network_show' => true));
     $pages = apply_filters('w3tc_menu', $pages, $this->_config, $this->_config_admin);
     $pages = array_merge($pages, $pages_tail);
     add_menu_page(__('Performance', 'w3-total-cache'), __('Performance', 'w3-total-cache'), 'manage_options', 'w3tc_dashboard', '', 'div');
     $submenu_pages = array();
     foreach ($pages as $slug => $titles) {
         if ($this->_config_admin->get_boolean('common.visible_by_master_only') && $titles['network_show'] || (!$this->_config_admin->get_boolean('common.visible_by_master_only') || is_super_admin() && (!w3_force_master() || is_network_admin()))) {
             $submenu_pages[] = add_submenu_page('w3tc_dashboard', $titles[0] . ' | W3 Total Cache', $titles[1], 'manage_options', $slug, array(&$this, 'options'));
         }
     }
     return $submenu_pages;
 }
开发者ID:rongandat,项目名称:sallumeh,代码行数:19,代码来源:Menus.php


示例6: admin_init

 /**
  * Setups actions
  */
 public function admin_init()
 {
     if (current_user_can('manage_options')) {
         /**
          * @var W3_ConfigCompatibility $config_comp
          */
         $config_comp = w3_instance('W3_ConfigCompatibility');
         if ($config_comp->get_old_version() && isset($_GET['page'])) {
             w3_require_once(W3TC_INC_FUNCTIONS_DIR . '/admin.php');
             if (is_w3tc_admin_page() || isset($GLOBALS['pagenow']) && 'plugins.php' === $GLOBALS['pagenow']) {
                 if (!w3_is_multisite() || !w3_force_master()) {
                     add_action('admin_notices', array($this, 'admin_notices'));
                 } else {
                     add_action('network_admin_notices', array($this, 'admin_notices'));
                 }
             }
             $config_comp->setup_settings();
         }
     }
 }
开发者ID:easinewe,项目名称:Avec2016,代码行数:23,代码来源:DefaultSettings.php


示例7: _can_cache2

 /**
  * Checks if can we do cache logic
  *
  * @param string $buffer
  * @return boolean
  */
 function _can_cache2(&$buffer)
 {
     /**
      * Skip if caching is disabled
      */
     if (!$this->_caching) {
         return false;
     }
     /**
      * Check for database error
      */
     if (w3_is_database_error($buffer)) {
         $this->cache_reject_reason = 'Database error occurred';
         return false;
     }
     /**
      * Check for DONOTCACHEPAGE constant
      */
     if (defined('DONOTCACHEPAGE') && DONOTCACHEPAGE) {
         $this->cache_reject_reason = 'DONOTCACHEPAGE constant is defined';
         return false;
     }
     /**
      * Check hostname
      */
     if ((!w3_is_multisite() || w3_is_multisite() && !w3_force_master()) && $this->_config->get_boolean('pgcache.check.domain') && w3_get_host() != w3_get_home_domain()) {
         $this->cache_reject_reason = 'Hostname mismatch';
         return false;
     }
     /**
      * Don't cache 404 pages
      */
     if (!$this->_config->get_boolean('pgcache.cache.404') && function_exists('is_404') && is_404()) {
         $this->cache_reject_reason = 'Page is 404';
         return false;
     }
     /**
      * Don't cache homepage
      */
     if (!$this->_config->get_boolean('pgcache.cache.home') && function_exists('is_home') && is_home()) {
         $this->cache_reject_reason = is_front_page() && is_home() ? 'Page is front page' : 'Page is posts page';
         return false;
     }
     /**
      * Don't cache front page
      */
     if ($this->_config->get_boolean('pgcache.reject.front_page') && function_exists('is_front_page') && is_front_page() && !is_home()) {
         $this->cache_reject_reason = 'Page is front page';
         return false;
     }
     /**
      * Don't cache feed
      */
     if (!$this->_config->get_boolean('pgcache.cache.feed') && function_exists('is_feed') && is_feed()) {
         $this->cache_reject_reason = 'Page is feed';
         return false;
     }
     /**
      * Check if page contains dynamic tags
      */
     if ($this->_enhanced_mode && $this->_has_dynamic($buffer)) {
         $this->cache_reject_reason = 'Page contains dynamic tags (mfunc or mclude) can not be cached in enhanced mode';
         return false;
     }
     return true;
 }
开发者ID:easinewe,项目名称:Avec2016,代码行数:72,代码来源:PgCache.php


示例8: selected

                </optgroup>
                <optgroup label="Multiple Servers:">
                    <option value="memcached"<?php 
selected($this->_config->get_string('fragmentcache.engine'), 'memcached');
if (!$check_memcached) {
    ?>
 disabled="disabled"<?php 
}
?>
>Memcached</option>
                </optgroup>
            </select>
        </td>
    </tr>
    <?php 
if ($this->is_network_and_master() && !w3_force_master()) {
    ?>
    <tr>
        <th>Network policy:</th>
        <td>
            <?php 
    $this->checkbox_admin('fragmentcache.configuration_sealed');
    ?>
 Apply the settings above to the entire network.</label>
        </td>
    </tr>
    <?php 
}
?>
</table>
开发者ID:Creative-Srijon,项目名称:top10bestwp,代码行数:30,代码来源:fragmentcache_general_section.php


示例9: w3tc_is_sealed

/**
 * Returns true if config section is sealed
 * @param string $section
 * @return boolean
 */
function w3tc_is_sealed($section)
{
    $config = w3_instance('W3_Config');
    $config_master = new W3_Config(true);
    $config_admin = w3_instance('W3_ConfigAdmin');
    if ($config->is_master()) {
        return false;
    }
    if (w3_is_network() && !$config->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' && !$config_master->get_boolean('minify.enabled')) {
        return true;
    }
    return $config_admin->get_boolean($section . '.configuration_sealed');
}
开发者ID:easinewe,项目名称:Avec2016,代码行数:25,代码来源:admin_ui.php


示例10:

    ?>
            <tr>
                <th colspan="2">
                    <?php 
    $this->checkbox('cdn.canonical_header');
    ?>
 Add canonical header</label><br />
                    <span class="description">Adds canonical <acronym title="Hypertext Transfer Protocol">HTTP</acronym> header to assets files.</span>
                </th>
            </tr>
            <?php 
}
?>
        </table>
<?php 
if (!$this->_config_admin->get_boolean('common.visible_by_master_only') || is_super_admin() && (!w3_force_master() || is_network_admin())) {
    ?>

        <p class="submit">
            <?php 
    echo $this->nonce_field('w3tc');
    ?>
            <input type="submit" name="w3tc_save_options" class="w3tc-button-save button-primary" value="Save all settings" />
        </p>
        <?php 
    echo $this->postbox_footer();
    ?>

        <?php 
    echo $this->postbox_header('Configuration', '', 'configuration');
    ?>
开发者ID:marqui678,项目名称:finalchance.Panopta,代码行数:31,代码来源:cdn.php


示例11: _e

        </tr>
        <?php 
        if ($this->is_network_and_master()) {
            ?>
        <tr>
            <th><?php 
            _e('Use above application name and ID for all sites in network:', 'w3-total-cache');
            ?>
</th>
            <td><?php 
            $this->checkbox('newrelic.use_network_wide_id');
            ?>
</label></td>
        </tr>
        <?php 
            if (!w3_force_master()) {
                ?>
        <tr>
            <th><?php 
                _e('Network policy:', 'w3-total-cache');
                ?>
</th>
            <td>
                <?php 
                $this->checkbox_admin('newrelic.configuration_sealed', $this->_config->get_boolean('newrelic.use_network_wide_id'));
                ?>
 <?php 
                _e('Apply the settings above to the entire network.', 'w3-total-cache');
                ?>
</label>
            </td>
开发者ID:Creative-Srijon,项目名称:top10bestwp,代码行数:31,代码来源:general.php


示例12: _get_config_filename

 private function _get_config_filename($force_master = false)
 {
     if ($this->_blog_id <= 0 || $force_master || w3_force_master()) {
         return W3TC_CONFIG_DIR . '/master-admin.php';
     }
     return W3TC_CONFIG_DIR . '/' . sprintf('%06d', $this->_blog_id) . '-admin.php';
 }
开发者ID:rongandat,项目名称:sallumeh,代码行数:7,代码来源:ConfigAdmin.php


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


示例14: _get_config_filename

 private function _get_config_filename($forced_preview = null)
 {
     $preview = is_null($forced_preview) ? $this->_preview : $forced_preview;
     $postfix = ($preview ? '-preview' : '') . '.php';
     if ($this->_blog_id <= 0 || w3_force_master()) {
         return W3TC_CACHE_CONFIG_DIR . '/master' . $postfix;
     }
     return W3TC_CACHE_CONFIG_DIR . '/' . sprintf('%06d', $this->_blog_id) . $postfix;
 }
开发者ID:gumbysgoo,项目名称:bestilblomster,代码行数:9,代码来源:Config.php


示例15: get_config_filename

 public static function get_config_filename()
 {
     $force_master = false;
     if (w3_force_master()) {
         $force_master = true;
     }
     $postfix = '.php';
     if (w3_get_blog_id() <= 0 || $force_master) {
         return W3TC_CONFIG_DIR . '/master' . $postfix;
     }
     return W3TC_CONFIG_DIR . '/' . sprintf('%06d', w3_get_blog_id()) . $postfix;
 }
开发者ID:beetleskin,项目名称:kathen,代码行数:12,代码来源:ConfigWriter.php


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


示例17: _e

    ?>
"><?php 
    _e('Visit extension site', 'w3-total-cache');
    ?>
</a>
                </div>
            </td>
        </tr>
        <?php 
    do_action("w3tc_extension_after_row", $extension);
    ?>
        <?php 
    do_action("w3tc_extension_after_row-{$extension}");
    ?>
        <?php 
    if (is_network_admin() && !w3_force_master()) {
        ?>
        <tr>
            <th></th>
            <th><?php 
        _e('Network policy:', 'w3-total-cache');
        ?>
</th>
                <td>
                    <?php 
        $this->checkbox_admin_extensions("extensions.configuration_sealed", $extension);
        ?>
 <?php 
        printf(__('Apply the %s settings to the entire network.', 'w3-total-cache'), $meta['name']);
        ?>
</label>
开发者ID:jfbelisle,项目名称:magexpress,代码行数:31,代码来源:list.php


示例18: action_save_options

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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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