* Static accessor class for site_stats and related things
*/
class SiteStats {
- /** @var bool|ResultWrapper */
+ /** @var bool|stdClass */
private static $row;
/** @var bool */
/** @var int[] */
private static $pageCount = [];
+ static function unload() {
+ self::$loaded = false;
+ }
+
static function recache() {
self::load( true );
}
}
/**
- * @return bool|ResultWrapper
+ * @return bool|stdClass
*/
static function loadAndLazyInit() {
global $wgMiserMode;
- wfDebug( __METHOD__ . ": reading site_stats from slave\n" );
+ wfDebug( __METHOD__ . ": reading site_stats from replica DB\n" );
$row = self::doLoad( wfGetDB( DB_SLAVE ) );
if ( !self::isSane( $row ) ) {
// Might have just been initialized during this request? Underflow?
- wfDebug( __METHOD__ . ": site_stats damaged or missing on slave\n" );
+ wfDebug( __METHOD__ . ": site_stats damaged or missing on replica DB\n" );
$row = self::doLoad( wfGetDB( DB_MASTER ) );
}
/**
* @param IDatabase $db
- * @return bool|ResultWrapper
+ * @return bool|stdClass
*/
static function doLoad( $db ) {
return $db->selectRow( 'site_stats', [
'ss_users',
'ss_active_users',
'ss_images',
- ], false, __METHOD__ );
+ ], [], __METHOD__ );
}
/**