MediaWiki  1.30.0
SiteStatsInit Class Reference

Class designed for counting of stats. More...

Public Member Functions

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

Static Public Member Functions

static doAllAndCommit ( $database, array $options=[])
 Do all updates and commit them. More...
 

Public Attributes

 $mArticles = null
 
 $mFiles = null
 
 $mPages = null
 

Private Attributes

 $db
 
 $mEdits = null
 
 $mUsers = null
 

Detailed Description

Class designed for counting of stats.

Definition at line 286 of file SiteStats.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 300 of file SiteStats.php.

References DB_MASTER, DB_REPLICA, and wfGetDB().

Member Function Documentation

◆ articles()

SiteStatsInit::articles ( )

Count pages in article space(s)

Returns
int

Definition at line 324 of file SiteStats.php.

References $mArticles, $tables, $wgArticleCountMethod, MWNamespace\getContentNamespaces(), and global.

Referenced by 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 master 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 387 of file SiteStats.php.

References $options, SiteStatsUpdate\cacheUpdate(), DB_MASTER, false, and wfGetDB().

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

◆ edits()

SiteStatsInit::edits ( )

Count the total number of edits.

Returns
int

Definition at line 314 of file SiteStats.php.

References $mEdits.

Referenced by refresh().

◆ files()

SiteStatsInit::files ( )

Count total files.

Returns
int

Definition at line 372 of file SiteStats.php.

References $mFiles.

Referenced by refresh().

◆ pages()

SiteStatsInit::pages ( )

Count total pages.

Returns
int

Definition at line 354 of file SiteStats.php.

References $mPages.

Referenced by refresh().

◆ refresh()

SiteStatsInit::refresh ( )

Refresh site_stats.

Definition at line 410 of file SiteStats.php.

References $mArticles, $mEdits, $mFiles, $mPages, $mUsers, articles(), DB_MASTER, edits(), files(), pages(), users(), and wfGetDB().

◆ users()

SiteStatsInit::users ( )

Count total users.

Returns
int

Definition at line 363 of file SiteStats.php.

References $mUsers.

Referenced by refresh().

Member Data Documentation

◆ $db

SiteStatsInit::$db
private

Definition at line 289 of file SiteStats.php.

◆ $mArticles

SiteStatsInit::$mArticles = null

Definition at line 292 of file SiteStats.php.

Referenced by articles(), and refresh().

◆ $mEdits

SiteStatsInit::$mEdits = null
private

Definition at line 292 of file SiteStats.php.

Referenced by edits(), and refresh().

◆ $mFiles

SiteStatsInit::$mFiles = null

Definition at line 293 of file SiteStats.php.

Referenced by files(), and refresh().

◆ $mPages

SiteStatsInit::$mPages = null

Definition at line 292 of file SiteStats.php.

Referenced by pages(), and refresh().

◆ $mUsers

SiteStatsInit::$mUsers = null
private

Definition at line 293 of file SiteStats.php.

Referenced by refresh(), and users().


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