本文整理汇总了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