本文整理匯總了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;
}
示例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';
}
示例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