* @return int
*/
static function numberingroup( $group ) {
- $cache = ObjectCache::getMainWANInstance();
+ $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
return $cache->getWithSetCallback(
- wfMemcKey( 'SiteStats', 'groupcounts', $group ),
+ $cache->makeKey( 'SiteStats', 'groupcounts', $group ),
$cache::TTL_HOUR,
function ( $oldValue, &$ttl, array &$setOpts ) use ( $group ) {
- global $wgDisableUserGroupExpiry;
$dbr = wfGetDB( DB_REPLICA );
$setOpts += Database::getCacheSetOptions( $dbr );
'COUNT(*)',
[
'ug_group' => $group,
- $wgDisableUserGroupExpiry ?
- '1' :
- 'ug_expiry IS NULL OR ug_expiry >= ' . $dbr->addQuotes( $dbr->timestamp() )
+ 'ug_expiry IS NULL OR ug_expiry >= ' . $dbr->addQuotes( $dbr->timestamp() )
],
__METHOD__
);
} catch ( JobQueueError $e ) {
self::$jobs = 0;
}
- /**
- * Zero rows still do single row read for row that doesn't exist,
- * but people are annoyed by that
- */
- if ( self::$jobs == 1 ) {
- self::$jobs = 0;
- }
}
return self::$jobs;
}
private $mUsers = null, $mFiles = null;
/**
- * Constructor
* @param bool|IDatabase $database
* - boolean: Whether to use the master DB
* - IDatabase: Database connection to use