MediaWiki  master
SiteStatsUpdate Class Reference

Class for handling updates to the site_stats table. More...

Inheritance diagram for SiteStatsUpdate:
Collaboration diagram for SiteStatsUpdate:

Public Member Functions

 __construct ( $views, $edits, $good, $pages=0, $users=0)
 
 doUpdate ()
 Perform the actual work. More...
 
 merge (MergeableUpdate $update)
 Merge this enqueued update with a new MergeableUpdate of the same qualified class name. More...
 

Static Public Member Functions

static cacheUpdate (IDatabase $dbw)
 
static factory (array $deltas)
 

Protected Attributes

int $articles = 0
 
int $edits = 0
 
int $images = 0
 
int $pages = 0
 
int $users = 0
 

Private Attributes

const SHARDS_OFF = 1
 
const SHARDS_ON = 10
 

Detailed Description

Class for handling updates to the site_stats table.

Definition at line 28 of file SiteStatsUpdate.php.

Constructor & Destructor Documentation

◆ __construct()

SiteStatsUpdate::__construct (   $views,
  $edits,
  $good,
  $pages = 0,
  $users = 0 
)
Deprecated:
since 1.39 Use SiteStatsUpdate::factory() instead.

Definition at line 55 of file SiteStatsUpdate.php.

References $edits, $pages, and $users.

Member Function Documentation

◆ cacheUpdate()

static SiteStatsUpdate::cacheUpdate ( IDatabase  $dbw)
static
Parameters
IDatabase$dbw
Returns
bool|mixed

Definition at line 170 of file SiteStatsUpdate.php.

References $dbr, DB_REPLICA, RC_EXTERNAL, SiteStats\unload(), and Wikimedia\Rdbms\IDatabase\update().

Referenced by SiteStatsInit\doAllAndCommit(), and InitSiteStats\execute().

◆ doUpdate()

◆ factory()

static SiteStatsUpdate::factory ( array  $deltas)
static
Parameters
int[]$deltasMap of (counter type => integer delta) e.g. ``` SiteStatsUpdate::factory( [ 'edits' => 10, 'articles' => 2, 'pages' => 7, 'users' => 5, ] ); ```
Returns
SiteStatsUpdate
Exceptions
UnexpectedValueException

Definition at line 85 of file SiteStatsUpdate.php.

Referenced by MediaWiki\Auth\AuthManager\autoCreateUser(), MediaWiki\Auth\AuthManager\continueAccountCreation(), Installer\createSysop(), LocalFile\deleteFile(), MediaWiki\Storage\DerivedPageDataUpdater\doUpdates(), LocalFileRestoreBatch\execute(), CreateAndPromote\execute(), NukePage\execute(), and WikiImporter\finishImportPage().

◆ merge()

SiteStatsUpdate::merge ( MergeableUpdate  $update)

Merge this enqueued update with a new MergeableUpdate of the same qualified class name.

Parameters
MergeableUpdate$updateThe new update (having the same class)

Implements MergeableUpdate.

Definition at line 62 of file SiteStatsUpdate.php.

Member Data Documentation

◆ $articles

int SiteStatsUpdate::$articles = 0
protected

Definition at line 34 of file SiteStatsUpdate.php.

◆ $edits

int SiteStatsUpdate::$edits = 0
protected

Definition at line 30 of file SiteStatsUpdate.php.

Referenced by __construct().

◆ $images

int SiteStatsUpdate::$images = 0
protected

Definition at line 38 of file SiteStatsUpdate.php.

◆ $pages

int SiteStatsUpdate::$pages = 0
protected

Definition at line 32 of file SiteStatsUpdate.php.

Referenced by __construct().

◆ $users

int SiteStatsUpdate::$users = 0
protected

Definition at line 36 of file SiteStatsUpdate.php.

Referenced by __construct().

◆ SHARDS_OFF

const SiteStatsUpdate::SHARDS_OFF = 1
private

Definition at line 40 of file SiteStatsUpdate.php.

Referenced by doUpdate().

◆ SHARDS_ON

const SiteStatsUpdate::SHARDS_ON = 10
private

Definition at line 41 of file SiteStatsUpdate.php.

Referenced by doUpdate().


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