MediaWiki  REL1_22
SiteStatsInit Class Reference

Class designed for counting of stats. More...

List of all members.

Public Member Functions

 __construct ($database=false)
 Constructor.
 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.
 update ()
 Update the current row with the selected values.
 users ()
 Count total users.
 views ()
 Count views.

Static Public Member Functions

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

Public Attributes

 $mArticles
 $mFiles = 0
 $mPages
 $mUsers
 $mViews

Private Member Functions

 getDbParams ()
 Return three arrays of params for the db queries.

Private Attributes

 $db
 $mEdits

Detailed Description

Class designed for counting of stats.

Definition at line 482 of file SiteStats.php.


Constructor & Destructor Documentation

SiteStatsInit::__construct ( database = false)

Constructor.

Parameters:
$databaseBoolean or DatabaseBase:
  • Boolean: whether to use the master DB
  • DatabaseBase: database connection to use

Definition at line 496 of file SiteStats.php.

References wfGetDB().


Member Function Documentation

Count pages in article space(s)

Returns:
Integer

Definition at line 518 of file SiteStats.php.

References array(), MWNamespace\getContentNamespaces(), and global.

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

Do all updates and commit them.

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

Parameters:
$databaseDatabaseBase|bool
  • Boolean: whether to use the master DB
  • DatabaseBase: database connection to use
array$optionsof options, may contain the following values
  • update Boolean: whether to update the current stats (true) or write fresh (false) (default: false)
  • views Boolean: when true, do not update the number of page views (default: true)
  • activeUsers Boolean: whether to update the number of active users (default: false)

Definition at line 592 of file SiteStats.php.

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

Referenced by SiteStats\loadAndLazyInit().

Count the total number of edits.

Returns:
Integer

Definition at line 508 of file SiteStats.php.

Count total files.

Returns:
Integer

Definition at line 575 of file SiteStats.php.

Return three arrays of params for the db queries.

Returns:
Array

Definition at line 646 of file SiteStats.php.

References array().

Referenced by refresh(), and update().

Count total pages.

Returns:
Integer

Definition at line 548 of file SiteStats.php.

Refresh site_stats.

Erase the current record and save all the new values.

Definition at line 635 of file SiteStats.php.

References getDbParams(), list, and wfGetDB().

Update the current row with the selected values.

Definition at line 625 of file SiteStats.php.

References getDbParams(), list, and wfGetDB().

Count total users.

Returns:
Integer

Definition at line 557 of file SiteStats.php.

Count views.

Returns:
Integer

Definition at line 566 of file SiteStats.php.


Member Data Documentation

SiteStatsInit::$db [private]

Definition at line 485 of file SiteStats.php.

SiteStatsInit::$mArticles

Definition at line 488 of file SiteStats.php.

SiteStatsInit::$mEdits [private]

Definition at line 488 of file SiteStats.php.

SiteStatsInit::$mFiles = 0

Definition at line 488 of file SiteStats.php.

SiteStatsInit::$mPages

Definition at line 488 of file SiteStats.php.

SiteStatsInit::$mUsers

Definition at line 488 of file SiteStats.php.

SiteStatsInit::$mViews

Definition at line 488 of file SiteStats.php.


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