MediaWiki  1.23.2
SiteStatsInit Class Reference

Class designed for counting of stats. More...

Public Member Functions

 __construct ( $database=false)
 Constructor. More...
 
 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...
 
 views ()
 Count views. More...
 

Static Public Member Functions

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

Public Attributes

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

Private Attributes

 $db
 
 $mEdits = null
 
 $mUsers = null
 

Detailed Description

Class designed for counting of stats.

Definition at line 257 of file SiteStats.php.

Constructor & Destructor Documentation

◆ __construct()

SiteStatsInit::__construct (   $database = false)

Constructor.

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

Definition at line 272 of file SiteStats.php.

References DB_MASTER, DB_SLAVE, and wfGetDB().

Member Function Documentation

◆ articles()

SiteStatsInit::articles ( )

Count pages in article space(s)

Returns
Integer

Definition at line 294 of file SiteStats.php.

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

Referenced by refresh().

◆ doAllAndCommit()

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
  • 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 367 of file SiteStats.php.

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

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

◆ edits()

SiteStatsInit::edits ( )

Count the total number of edits.

Returns
Integer

Definition at line 284 of file SiteStats.php.

References $mEdits.

Referenced by refresh().

◆ files()

SiteStatsInit::files ( )

Count total files.

Returns
Integer

Definition at line 351 of file SiteStats.php.

References $mFiles.

Referenced by refresh().

◆ pages()

SiteStatsInit::pages ( )

Count total pages.

Returns
Integer

Definition at line 324 of file SiteStats.php.

References $mPages.

Referenced by refresh().

◆ refresh()

SiteStatsInit::refresh ( )

Refresh site_stats.

If you want ss_total_views to be updated, be sure to call views() first.

Definition at line 396 of file SiteStats.php.

References array(), articles(), DB_MASTER, edits(), files(), pages(), users(), and wfGetDB().

◆ users()

SiteStatsInit::users ( )

Count total users.

Returns
Integer

Definition at line 333 of file SiteStats.php.

References $mUsers.

Referenced by refresh().

◆ views()

SiteStatsInit::views ( )

Count views.

Returns
Integer

Definition at line 342 of file SiteStats.php.

References $mViews.

Member Data Documentation

◆ $db

SiteStatsInit::$db
private

Definition at line 260 of file SiteStats.php.

◆ $mArticles

SiteStatsInit::$mArticles = null

Definition at line 263 of file SiteStats.php.

Referenced by articles().

◆ $mEdits

SiteStatsInit::$mEdits = null
private

Definition at line 263 of file SiteStats.php.

Referenced by edits().

◆ $mFiles

SiteStatsInit::$mFiles = null

Definition at line 264 of file SiteStats.php.

Referenced by files().

◆ $mPages

SiteStatsInit::$mPages = null

Definition at line 263 of file SiteStats.php.

Referenced by pages().

◆ $mUsers

SiteStatsInit::$mUsers = null
private

Definition at line 264 of file SiteStats.php.

Referenced by users().

◆ $mViews

SiteStatsInit::$mViews = null

Definition at line 264 of file SiteStats.php.

Referenced by views().


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