MediaWiki  1.33.0
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().

Referenced by loadAndLazyInit().

◆ edits()

static SiteStats::edits ( )
static

◆ getLB()

static SiteStats::getLB ( )
staticprivate
Returns
LoadBalancer

Definition at line 300 of file SiteStats.php.

Referenced by loadAndLazyInit(), numberingroup(), and pagesInNs().

◆ 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.

References $row, and as.

◆ 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, $e, array(), and JobQueueGroup\singleton().

Referenced by SiteStatsTest\testJobsCountGetCached(), and ApiQuerySiteinfoTest\testStatistics().

◆ load()

static SiteStats::load ( )
staticprotected

Definition at line 42 of file SiteStats.php.

References loadAndLazyInit().

Referenced by activeUsers(), articles(), edits(), images(), pages(), and users().

◆ loadAndLazyInit()

static SiteStats::loadAndLazyInit ( )
staticprotected

◆ 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, $fname, array(), DB_REPLICA, getLB(), and use.

Referenced by SpecialStatistics\getGroupStats(), CoreParserFunctions\numberingroup(), CoreParserFunctions\numberofadmins(), ApiQuerySiteinfoTest\testStatistics(), and ApiQuerySiteinfoTest\testUserGroups().

◆ pages()

static SiteStats::pages ( )
static

◆ pagesInNs()

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

Definition at line 201 of file SiteStats.php.

References $cache, $dbr, $fname, array(), DB_REPLICA, getLB(), and use.

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, $value, array(), and as.

Referenced by loadAndLazyInit().

◆ 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(), SiteStatsUpdateTest\testDoUpdate(), and SiteStatsUpdate\tryDBUpdateInternal().

◆ users()

Member Data Documentation

◆ $row

stdClass SiteStats::$row
staticprivate

Definition at line 33 of file SiteStats.php.

Referenced by isRowSane(), loadAndLazyInit(), and salvageInsaneRow().


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