MediaWiki  REL1_20
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 464 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 478 of file SiteStats.php.

References wfGetDB().


Member Function Documentation

Count pages in article space(s)

Returns:
Integer

Definition at line 500 of file SiteStats.php.

References MWNamespace\getContentNamespaces().

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
$optionsArray of 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 574 of file SiteStats.php.

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

Referenced by SiteStats\loadAndLazyInit().

Count the total number of edits.

Returns:
Integer

Definition at line 490 of file SiteStats.php.

Count total files.

Returns:
Integer

Definition at line 557 of file SiteStats.php.

Return three arrays of params for the db queries.

Returns:
Array

Definition at line 628 of file SiteStats.php.

Referenced by refresh(), and update().

Count total pages.

Returns:
Integer

Definition at line 530 of file SiteStats.php.

Refresh site_stats.

Erase the current record and save all the new values.

Definition at line 617 of file SiteStats.php.

References getDbParams(), and wfGetDB().

Update the current row with the selected values.

Definition at line 607 of file SiteStats.php.

References getDbParams(), and wfGetDB().

Count total users.

Returns:
Integer

Definition at line 539 of file SiteStats.php.

Count views.

Returns:
Integer

Definition at line 548 of file SiteStats.php.


Member Data Documentation

SiteStatsInit::$db [private]

Definition at line 467 of file SiteStats.php.

SiteStatsInit::$mArticles

Definition at line 470 of file SiteStats.php.

SiteStatsInit::$mEdits [private]

Definition at line 470 of file SiteStats.php.

SiteStatsInit::$mFiles = 0

Definition at line 470 of file SiteStats.php.

SiteStatsInit::$mPages

Definition at line 470 of file SiteStats.php.

SiteStatsInit::$mUsers

Definition at line 470 of file SiteStats.php.

SiteStatsInit::$mViews

Definition at line 470 of file SiteStats.php.


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