- 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
- // clean schema with mwdumper.
- wfDebug( __METHOD__ . ": initializing damaged or missing site_stats\n" );
-
- SiteStatsInit::doAllAndCommit( wfGetDB( DB_REPLICA ) );
+ if ( !self::isSane( $row ) ) {
+ if ( $wgMiserMode ) {
+ // Start off with all zeroes, assuming that this is a new wiki or any
+ // repopulations where done manually via script.
+ SiteStatsInit::doPlaceholderInit();
+ } else {
+ // 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
+ // clean schema with mwdumper.
+ wfDebug( __METHOD__ . ": initializing damaged or missing site_stats\n" );
+ SiteStatsInit::doAllAndCommit( wfGetDB( DB_REPLICA ) );
+ }