MediaWiki  master
SiteStats Class Reference

Static accessor class for site_stats and related things. More...

Collaboration diagram for SiteStats:

Static Public Member Functions

static activeUsers ()
 
static articles ()
 
static edits ()
 
static images ()
 
static jobs ()
 Total number of jobs in the job queue. More...
 
static numberingroup ( $group)
 Find the number of users in a given user group. More...
 
static pages ()
 
static pagesInNs ( $ns)
 
static selectFields ()
 
static unload ()
 Trigger a reload next time a field is accessed. More...
 
static users ()
 

Static Protected Member Functions

static load ()
 
static loadAndLazyInit ()
 

Static Private Member Functions

static doLoadFromDB (IDatabase $db)
 
static getLB ()
 
static isRowSane ( $row)
 Is the provided row of site stats sane, or should it be regenerated? More...
 
static salvageInsaneRow ( $row)
 

Static Private Attributes

static stdClass $row
 

Detailed Description

Static accessor class for site_stats and related things.

Definition at line 31 of file SiteStats.php.

Member Function Documentation

◆ activeUsers()

static SiteStats::activeUsers ( )
static

◆ articles()

static SiteStats::articles ( )
static

◆ doLoadFromDB()

static SiteStats::doLoadFromDB ( IDatabase  $db)
staticprivate
Parameters
IDatabase$db
Returns
stdClass|bool

Definition at line 241 of file SiteStats.php.

References Wikimedia\Rdbms\IDatabase\selectRow().

◆ edits()

static SiteStats::edits ( )
static

◆ getLB()

static SiteStats::getLB ( )
staticprivate
Returns
LoadBalancer

Definition at line 300 of file SiteStats.php.

◆ images()

static SiteStats::images ( )
static

◆ isRowSane()

static SiteStats::isRowSane (   $row)
staticprivate

Is the provided row of site stats sane, or should it be regenerated?

Checks only fields which are filled by SiteStatsInit::refresh.

Parameters
bool | object$row
Returns
bool

Definition at line 258 of file SiteStats.php.

◆ jobs()

static SiteStats::jobs ( )
static

Total number of jobs in the job queue.

Returns
int

Definition at line 179 of file SiteStats.php.

References $cache, and JobQueueGroup\singleton().

Referenced by ApiQuerySiteinfo\appendStatistics().

◆ load()

static SiteStats::load ( )
staticprotected

Definition at line 42 of file SiteStats.php.

◆ loadAndLazyInit()

static SiteStats::loadAndLazyInit ( )
staticprotected
Returns
stdClass

Definition at line 51 of file SiteStats.php.

References $dbr, $row, DB_MASTER, DB_REPLICA, SiteStatsInit\doAllAndCommit(), SiteStatsInit\doPlaceholderInit(), and wfDebug().

◆ numberingroup()

static SiteStats::numberingroup (   $group)
static

Find the number of users in a given user group.

Parameters
string$groupName of group
Returns
int

Definition at line 150 of file SiteStats.php.

References $cache, $dbr, and DB_REPLICA.

Referenced by ApiQuerySiteinfo\appendStatistics(), ApiQuerySiteinfo\appendUserGroups(), SpecialStatistics\getGroupStats(), Parser\getVariableValue(), CoreParserFunctions\numberingroup(), and CoreParserFunctions\numberofadmins().

◆ pages()

◆ pagesInNs()

static SiteStats::pagesInNs (   $ns)
static
Parameters
int$ns
Returns
int

Definition at line 201 of file SiteStats.php.

References $cache, $dbr, and DB_REPLICA.

Referenced by CoreParserFunctions\pagesinnamespace().

◆ salvageInsaneRow()

static SiteStats::salvageInsaneRow (   $row)
staticprivate
Parameters
stdClass | bool$row
Returns
stdClass

Definition at line 285 of file SiteStats.php.

References $row.

◆ selectFields()

static SiteStats::selectFields ( )
static
Returns
array

Definition at line 226 of file SiteStats.php.

Referenced by SiteStatsInit\doPlaceholderInit().

◆ unload()

static SiteStats::unload ( )
static

Trigger a reload next time a field is accessed.

Definition at line 38 of file SiteStats.php.

Referenced by SiteStatsUpdate\cacheUpdate(), and SiteStatsUpdate\doUpdate().

◆ users()

Member Data Documentation

◆ $row

stdClass SiteStats::$row
staticprivate

Definition at line 33 of file SiteStats.php.

Referenced by loadAndLazyInit(), and salvageInsaneRow().


The documentation for this class was generated from the following file: