MediaWiki REL1_39
SiteStatsInit Class Reference

Class designed for counting of stats. More...

Public Member Functions

 __construct ( $database=false)
 
 articles ()
 Count pages in article space(s)
 
 edits ()
 Count the total number of edits.
 
 files ()
 Count total files.
 
 pages ()
 Count total pages.
 
 refresh ()
 Refresh site_stats.
 
 users ()
 Count total users.
 

Static Public Member Functions

static doAllAndCommit ( $database, array $options=[])
 Do all updates and commit them.
 
static doPlaceholderInit ()
 Insert a dummy row with all zeroes if no row is present.
 

Detailed Description

Class designed for counting of stats.

Definition at line 28 of file SiteStatsInit.php.

Constructor & Destructor Documentation

◆ __construct()

SiteStatsInit::__construct (   $database = false)
Parameters
bool | IDatabase$database
  • bool: Whether to use the primary DB
  • IDatabase: Database connection to use

Definition at line 47 of file SiteStatsInit.php.

References DB_PRIMARY, DB_REPLICA, and getDB().

Member Function Documentation

◆ articles()

SiteStatsInit::articles ( )

Count pages in article space(s)

Returns
int

Definition at line 72 of file SiteStatsInit.php.

References articles().

Referenced by articles(), and refresh().

◆ doAllAndCommit()

static SiteStatsInit::doAllAndCommit (   $database,
array  $options = [] 
)
static

Do all updates and commit them.

More or less a replacement for the original initStats, but without output.

Parameters
IDatabase | bool$database
  • bool: Whether to use the primary DB
  • IDatabase: Database connection to use
array$optionsArray of options, may contain the following values
  • activeUsers bool: Whether to update the number of active users (default: false)

Definition at line 136 of file SiteStatsInit.php.

References DB_PRIMARY.

Referenced by DatabaseUpdater\checkStats(), and SiteStats\loadAndLazyInit().

◆ doPlaceholderInit()

static SiteStatsInit::doPlaceholderInit ( )
static

Insert a dummy row with all zeroes if no row is present.

Definition at line 159 of file SiteStatsInit.php.

References DB_PRIMARY, getDB(), and SiteStats\selectFields().

Referenced by SiteStats\loadAndLazyInit().

◆ edits()

SiteStatsInit::edits ( )

Count the total number of edits.

Returns
int

Definition at line 61 of file SiteStatsInit.php.

References edits().

Referenced by edits(), and refresh().

◆ files()

SiteStatsInit::files ( )

Count total files.

Returns
int

Definition at line 120 of file SiteStatsInit.php.

References files().

Referenced by files(), and refresh().

◆ pages()

SiteStatsInit::pages ( )

Count total pages.

Returns
int

Definition at line 100 of file SiteStatsInit.php.

References pages().

Referenced by pages(), and refresh().

◆ refresh()

SiteStatsInit::refresh ( )

Refresh site_stats.

Definition at line 185 of file SiteStatsInit.php.

References articles(), DB_PRIMARY, edits(), files(), getDB(), pages(), and users().

◆ users()

SiteStatsInit::users ( )

Count total users.

Returns
int

Definition at line 110 of file SiteStatsInit.php.

References users().

Referenced by refresh(), and users().


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