當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。