當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Util_Environment::is_dbcluster方法代碼示例

本文整理匯總了PHP中Util_Environment::is_dbcluster方法的典型用法代碼示例。如果您正苦於以下問題:PHP Util_Environment::is_dbcluster方法的具體用法?PHP Util_Environment::is_dbcluster怎麽用?PHP Util_Environment::is_dbcluster使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Util_Environment的用法示例。


在下文中一共展示了Util_Environment::is_dbcluster方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: instance

 /**
  * Returns object instance. Called by WP engine
  *
  * @return DbCache_Wpdb
  */
 static function instance()
 {
     static $instance = null;
     if (is_null($instance)) {
         $processors = array();
         $call_default_constructor = true;
         // no caching during activation
         $is_installing = defined('WP_INSTALLING') && WP_INSTALLING;
         $config = Dispatcher::config();
         if (!$is_installing && $config->get_boolean('dbcache.enabled')) {
             $processors[] = new DbCache_WpdbInjection_QueryCaching();
         }
         if (Util_Environment::is_dbcluster()) {
             $processors[] = new Enterprise_Dbcache_WpdbInjection_Cluster();
         }
         $processors[] = new DbCache_WpdbInjection();
         $class = __CLASS__;
         $o = new $class($processors);
         $next_injection = new _CallUnderlying($o);
         foreach ($processors as $processor) {
             $processor->initialize_injection($o, $next_injection);
         }
         // initialize after processors configured
         $o->initialize();
         $instance = $o;
     }
     return $instance;
 }
開發者ID:developmentDM2,項目名稱:Whohaha,代碼行數:33,代碼來源:DbCache_Wpdb.php

示例2: dbcluster_config

 /**
  * Database cluster config editor
  *
  * @return void
  */
 function dbcluster_config()
 {
     $this->_page = 'w3tc_dbcluster_config';
     if (Util_Environment::is_dbcluster()) {
         $content = @file_get_contents(W3TC_FILE_DB_CLUSTER_CONFIG);
     } else {
         $content = @file_get_contents(W3TC_DIR . '/ini/dbcluster-config-sample.php');
     }
     include W3TC_INC_OPTIONS_DIR . '/enterprise/dbcluster-config.php';
 }
開發者ID:developmentDM2,項目名稱:Whohaha,代碼行數:15,代碼來源:DbCache_Page.php

示例3:

<?php

namespace W3TC;

if (!defined('W3TC')) {
    die;
}
?>
<tr>
    <th><label for="w3tc_dbcluster_config">Database cluster:</th>
    <td>
        <input type="submit" id="w3tc_dbcluster_config" name="w3tc_dbcluster_config" class="button"
               value="<?php 
echo Util_Environment::is_dbcluster() ? 'Edit Database Cluster Configuration' : 'Enable database cluster';
?>
" /><br />
        <span class="description">Create db-cluster-config.php file with your database cluster configuration to enable it.</span>
    </td>
</tr>
<?php 
開發者ID:developmentDM2,項目名稱:Whohaha,代碼行數:20,代碼來源:dbcluster_general_section.php


注:本文中的Util_Environment::is_dbcluster方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。