MediaWiki  1.29.2
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 doLoad ( $db)
 
static edits ()
 
static images ()
 
static jobs ()
 
static load ( $recache=false)
 
static loadAndLazyInit ()
 
static numberingroup ( $group)
 Find the number of users in a given user group. More...
 
static pages ()
 
static pagesInNs ( $ns)
 
static recache ()
 
static unload ()
 
static users ()
 
static views ()
 Return the total number of page views. More...
 

Static Private Member Functions

static isSane ( $row)
 Is the provided row of site stats sane, or should it be regenerated? More...
 

Static Private Attributes

static int $jobs
 
static bool $loaded = false
 
static int[] $pageCount = []
 
static bool stdClass $row
 

Detailed Description

Static accessor class for site_stats and related things.

Definition at line 29 of file SiteStats.php.

Member Function Documentation

◆ activeUsers()

static SiteStats::activeUsers ( )
static
Returns
int

Definition at line 168 of file SiteStats.php.

References load().

Referenced by SpecialStatistics\execute(), and CoreParserFunctions\numberofactiveusers().

◆ articles()

static SiteStats::articles ( )
static
Returns
int

Definition at line 144 of file SiteStats.php.

References load().

Referenced by SpecialStatistics\execute(), and CoreParserFunctions\numberofarticles().

◆ doLoad()

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

Definition at line 108 of file SiteStats.php.

Referenced by load(), and loadAndLazyInit().

◆ edits()

static SiteStats::edits ( )
static
Returns
int

Definition at line 136 of file SiteStats.php.

References load().

Referenced by SpecialStatistics\execute(), and CoreParserFunctions\numberofedits().

◆ images()

static SiteStats::images ( )
static
Returns
int

Definition at line 176 of file SiteStats.php.

References load().

Referenced by SpecialStatistics\execute(), and CoreParserFunctions\numberoffiles().

◆ isSane()

static SiteStats::isSane (   $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
Returns
int

Definition at line 213 of file SiteStats.php.

References $e, $jobs, and JobQueueGroup\singleton().

◆ load()

static SiteStats::load (   $recache = false)
static
Parameters
bool$recache

Definition at line 53 of file SiteStats.php.

References DB_REPLICA, doLoad(), loadAndLazyInit(), and wfGetDB().

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

◆ loadAndLazyInit()

static SiteStats::loadAndLazyInit ( )
static
Returns
bool|stdClass

Definition at line 74 of file SiteStats.php.

References $row, $wgMiserMode, DB_MASTER, DB_REPLICA, SiteStatsInit\doAllAndCommit(), doLoad(), global, wfDebug(), and wfGetDB().

Referenced by load().

◆ 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 186 of file SiteStats.php.

References $cache, $dbr, array(), DB_REPLICA, ObjectCache\getMainWANInstance(), use, wfGetDB(), and wfMemcKey().

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

◆ pages()

static SiteStats::pages ( )
static
Returns
int

Definition at line 152 of file SiteStats.php.

References load().

Referenced by SpecialStatistics\execute(), and CoreParserFunctions\numberofpages().

◆ pagesInNs()

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

Definition at line 236 of file SiteStats.php.

References $dbr, DB_REPLICA, and wfGetDB().

Referenced by CoreParserFunctions\pagesinnamespace().

◆ recache()

static SiteStats::recache ( )
static

Definition at line 46 of file SiteStats.php.

References load().

◆ unload()

static SiteStats::unload ( )
static

◆ users()

static SiteStats::users ( )
static
Returns
int

Definition at line 160 of file SiteStats.php.

References load().

Referenced by SpecialStatistics\execute(), and CoreParserFunctions\numberofusers().

◆ views()

static SiteStats::views ( )
static

Return the total number of page views.

Except we don't track those anymore. Stop calling this function, it will be removed some time in the future. It's kept here simply to prevent fatal errors.

Deprecated:
since 1.25
Returns
int

Definition at line 128 of file SiteStats.php.

References wfDeprecated().

Member Data Documentation

◆ $jobs

int SiteStats::$jobs
staticprivate

Definition at line 37 of file SiteStats.php.

Referenced by jobs().

◆ $loaded

bool SiteStats::$loaded = false
staticprivate

Definition at line 34 of file SiteStats.php.

◆ $pageCount

int [] SiteStats::$pageCount = []
staticprivate

Definition at line 40 of file SiteStats.php.

◆ $row

bool stdClass SiteStats::$row
staticprivate

Definition at line 31 of file SiteStats.php.

Referenced by isSane(), and loadAndLazyInit().


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