'none' => 'ApiFormatNone',
];
- // @codingStandardsIgnoreStart String contenation on "msg" not allowed to break long line
/**
* List of user roles that are specifically relevant to the API.
* [ 'right' => [ 'msg' => 'Some message with a $1',
'params' => [ ApiBase::LIMIT_SML2, ApiBase::LIMIT_BIG2 ]
]
];
- // @codingStandardsIgnoreEnd
/**
* @var ApiFormatBase
if ( $module->isWriteMode()
&& $this->getUser()->isBot()
- && wfGetLB()->getServerCount() > 1
+ && MediaWikiServices::getInstance()->getDBLoadBalancer()->getServerCount() > 1
) {
$this->checkBotReadOnly();
}
$numLagged = 0;
$lagLimit = $this->getConfig()->get( 'APIMaxLagThreshold' );
$laggedServers = [];
- $loadBalancer = wfGetLB();
+ $loadBalancer = MediaWikiServices::getInstance()->getDBLoadBalancer();
foreach ( $loadBalancer->getLagTimes() as $serverIndex => $lag ) {
if ( $lag > $lagLimit ) {
++$numLagged;
}
// If a majority of replica DBs are too lagged then disallow writes
- $replicaCount = wfGetLB()->getServerCount() - 1;
+ $replicaCount = $loadBalancer->getServerCount() - 1;
if ( $numLagged >= ceil( $replicaCount / 2 ) ) {
$laggedServers = implode( ', ', $laggedServers );
wfDebugLog(
$id = Sanitizer::escapeIdForAttribute( 'main/datatypes', Sanitizer::ID_PRIMARY );
$idFallback = Sanitizer::escapeIdForAttribute( 'main/datatypes', Sanitizer::ID_FALLBACK );
$headline = Linker::makeHeadline( min( 6, $level ),
- ' class="apihelp-header"',
+ ' class="apihelp-header">',
$id,
$header,
'',
$id = Sanitizer::escapeIdForAttribute( 'main/credits', Sanitizer::ID_PRIMARY );
$idFallback = Sanitizer::escapeIdForAttribute( 'main/credits', Sanitizer::ID_FALLBACK );
$headline = Linker::makeHeadline( min( 6, $level ),
- ' class="apihelp-header"',
+ ' class="apihelp-header">',
$id,
$header,
'',