* @return bool|ResultWrapper
*/
static function loadAndLazyInit() {
+ global $wgMiserMode;
+
wfDebug( __METHOD__ . ": reading site_stats from slave\n" );
$row = self::doLoad( wfGetDB( DB_SLAVE ) );
$row = self::doLoad( wfGetDB( DB_MASTER ) );
}
- if ( !self::isSane( $row ) ) {
+ if ( !$wgMiserMode && !self::isSane( $row ) ) {
// Normally the site_stats table is initialized at install time.
// Some manual construction scenarios may leave the table empty or
// broken, however, for instance when importing from a dump into a
}
/**
- * @param DatabaseBase $db
+ * @param IDatabase $db
* @return bool|ResultWrapper
*/
static function doLoad( $db ) {
* @return int
*/
static function pagesInNs( $ns ) {
- wfProfileIn( __METHOD__ );
if ( !isset( self::$pageCount[$ns] ) ) {
$dbr = wfGetDB( DB_SLAVE );
self::$pageCount[$ns] = (int)$dbr->selectField(
__METHOD__
);
}
- wfProfileOut( __METHOD__ );
return self::$pageCount[$ns];
}
* Do all updates and commit them. More or less a replacement
* for the original initStats, but without output.
*
- * @param DatabaseBase|bool $database
+ * @param IDatabase|bool $database
* - Boolean: whether to use the master DB
* - DatabaseBase: database connection to use
* @param array $options Array of options, may contain the following values