本文整理汇总了PHP中LoadBalancer::newFromParams方法的典型用法代码示例。如果您正苦于以下问题:PHP LoadBalancer::newFromParams方法的具体用法?PHP LoadBalancer::newFromParams怎么用?PHP LoadBalancer::newFromParams使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LoadBalancer
的用法示例。
在下文中一共展示了LoadBalancer::newFromParams方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
/**
* Fetch data from given URL
* @param string $url An url
*/
function &getLoadBalancer($cluster)
{
global $wgExternalServers;
if (!array_key_exists($cluster, $this->loadBalancers)) {
$this->loadBalancers[$cluster] = LoadBalancer::newFromParams($wgExternalServers[$cluster]);
}
return $this->loadBalancers[$cluster];
}
示例2:
/** @todo Document.*/
function &getLoadBalancer($cluster)
{
global $wgExternalServers, $wgExternalLoadBalancers;
if (!array_key_exists($cluster, $wgExternalLoadBalancers)) {
$wgExternalLoadBalancers[$cluster] = LoadBalancer::newFromParams($wgExternalServers[$cluster]);
}
$wgExternalLoadBalancers[$cluster]->allowLagged(true);
return $wgExternalLoadBalancers[$cluster];
}
示例3: session_name
session_name($wgSessionName ? $wgSessionName : $wgCookiePrefix . '_session');
}
if (!$wgCommandLineMode && (isset($_COOKIE[session_name()]) || isset($_COOKIE[$wgCookiePrefix . 'Token']))) {
wfIncrStats('request_with_session');
User::SetupSession();
$wgSessionStarted = true;
} else {
wfIncrStats('request_without_session');
$wgSessionStarted = false;
}
wfProfileOut($fname . '-SetupSession');
wfProfileIn($fname . '-database');
if (!$wgDBservers) {
$wgDBservers = array(array('host' => $wgDBserver, 'user' => $wgDBuser, 'password' => $wgDBpassword, 'dbname' => $wgDBname, 'type' => $wgDBtype, 'load' => 1, 'flags' => ($wgDebugDumpSql ? DBO_DEBUG : 0) | DBO_DEFAULT));
}
$wgLoadBalancer = LoadBalancer::newFromParams($wgDBservers, false, $wgMasterWaitTimeout);
$wgLoadBalancer->loadMasterPos();
wfProfileOut($fname . '-database');
wfProfileIn($fname . '-language1');
require_once "{$IP}/languages/Language.php";
function setupLangObj($langclass)
{
global $IP;
if (!class_exists($langclass)) {
# Default to English/UTF-8
$baseclass = 'LanguageUtf8';
require_once "{$IP}/languages/{$baseclass}.php";
$lc = strtolower(substr($langclass, 8));
$snip = "\n\t\t\tclass {$langclass} extends {$baseclass} {\n\t\t\t\tfunction getVariants() {\n\t\t\t\t\treturn array(\"{$lc}\");\n\t\t\t\t}\n\n\t\t\t}";
eval($snip);
}