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


PHP Util_Environment::is_using_master_config方法代码示例

本文整理汇总了PHP中Util_Environment::is_using_master_config方法的典型用法代码示例。如果您正苦于以下问题:PHP Util_Environment::is_using_master_config方法的具体用法?PHP Util_Environment::is_using_master_config怎么用?PHP Util_Environment::is_using_master_config使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Util_Environment的用法示例。


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

示例1: __construct

 public function __construct($blog_id = null)
 {
     if (!is_null($blog_id)) {
         $this->_blog_id = $blog_id;
         $this->_is_master = $this->_blog_id == 0;
     } else {
         if (Util_Environment::is_using_master_config()) {
             $this->_blog_id = 0;
         } else {
             $this->_blog_id = Util_Environment::blog_id();
         }
         $this->_is_master = Util_Environment::blog_id() == 0;
     }
     $this->_preview = Util_Environment::is_preview_mode();
     $this->load();
 }
开发者ID:developmentDM2,项目名称:Whohaha,代码行数:16,代码来源:Config.php

示例2: uri_to_cdn_uri

 /**
  * Convert local uri path to CDN type specific path
  *
  * @param unknown $local_uri_path
  * @return string
  */
 function uri_to_cdn_uri($local_uri)
 {
     $local_uri = ltrim($local_uri, '/');
     $remote_uri = $local_uri;
     if (Util_Environment::is_wpmu() && defined('DOMAIN_MAPPING') && DOMAIN_MAPPING) {
         $remote_uri = str_replace(site_url(), '', $local_uri);
     }
     $engine = $this->_config->get_string('cdn.engine');
     if (Cdn_Util::is_engine_mirror($engine)) {
         if (Util_Environment::is_wpmu() && strpos($local_uri, 'files') === 0) {
             $upload_dir = Util_Environment::wp_upload_dir();
             $remote_uri = $this->abspath_to_relative_path(dirname($upload_dir['basedir'])) . '/' . $local_uri;
         }
     } elseif (Util_Environment::is_wpmu() && !Util_Environment::is_wpmu_subdomain() && Util_Environment::is_using_master_config() && Cdn_Util::is_engine_push($engine)) {
         // in common config files are uploaded for network home url
         // so mirror will not contain /subblog/ path in uri
         $home = trim(home_url('', 'relative'), '/') . '/';
         $network_home = trim(network_home_url('', 'relative'), '/') . '/';
         if ($home != $network_home && substr($local_uri, 0, strlen($home)) == $home) {
             $remote_uri = $network_home . substr($local_uri, strlen($home));
         }
     }
     return ltrim($remote_uri, '/');
 }
开发者ID:developmentDM2,项目名称:Whohaha,代码行数:30,代码来源:Cdn_Core.php

示例3:

<?php

namespace W3TC;

if (!defined('W3TC')) {
    die;
}
// when separate config is used - each blog has own uploads
// so nothing to upload from network admin
$upload_blogfiles_enabled = $cdn_mirror || !is_network_admin() || !Util_Environment::is_using_master_config();
include W3TC_INC_DIR . '/options/common/header.php';
?>
<p id="w3tc-options-menu">
	<?php 
_e('Jump to:', 'w3-total-cache');
?>
	<a href="#toplevel_page_w3tc_general"><?php 
_e('Main Menu', 'w3-total-cache');
?>
</a> |
	<a href="#general"><?php 
_e('General', 'w3-total-cache');
?>
</a> |
	<a href="#configuration"><?php 
_e('Configuration', 'w3-total-cache');
?>
</a> |
	<a href="#advanced"><?php 
_e('Advanced', 'w3-total-cache');
?>
开发者ID:developmentDM2,项目名称:Whohaha,代码行数:31,代码来源:cdn.php

示例4: cache_blog_minify_dir

 public static function cache_blog_minify_dir()
 {
     // when minify manual used with a shared config - shared
     // minify urls has to be used too, since CDN upload is possible
     // only from network admin
     if (Util_Environment::is_wpmu() && Util_Environment::is_using_master_config() && !Dispatcher::config()->get_boolean('minify.auto')) {
         $path = Util_Environment::cache_blog_dir('minify', 0);
     } else {
         $path = Util_Environment::cache_blog_dir('minify');
     }
     return $path;
 }
开发者ID:developmentDM2,项目名称:Whohaha,代码行数:12,代码来源:Util_Environment.php


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