MediaWiki REL1_33
|
Class for handling updates to the site_stats table. More...
Public Member Functions | |
__construct ( $views, $edits, $good, $pages=0, $users=0) | |
doUpdate () | |
Perform the actual work. | |
merge (MergeableUpdate $update) | |
Merge this update with $update. | |
tryDBUpdateInternal () | |
Do not call this outside of SiteStatsUpdate. | |
Static Public Member Functions | |
static | cacheUpdate (IDatabase $dbw) |
static | factory (array $deltas) |
Protected Member Functions | |
adjustPending ( $type, $delta) | |
Adjust the pending deltas for a stat type. | |
appendUpdate (&$sql, $field, $delta) | |
doUpdateContextStats () | |
doUpdatePendingDeltas () | |
getPendingDeltas () | |
Get pending delta counters for each stat type. | |
removePendingDeltas (array $pd) | |
Reduce pending delta counters after updates have been applied. | |
Protected Attributes | |
int | $articles = 0 |
int | $edits = 0 |
int | $images = 0 |
int | $pages = 0 |
BagOStuff | $stash |
int | $users = 0 |
Private Member Functions | |
getTypeCacheKey (BagOStuff $stash, $type, $sign) | |
Static Private Attributes | |
static | $counters = [ 'edits', 'pages', 'articles', 'users', 'images' ] |
Class for handling updates to the site_stats table.
Definition at line 27 of file SiteStatsUpdate.php.
SiteStatsUpdate::__construct | ( | $views, | |
$edits, | |||
$good, | |||
$pages = 0, | |||
$users = 0 ) |
Definition at line 44 of file SiteStatsUpdate.php.
|
protected |
Adjust the pending deltas for a stat type.
Each stat type has two pending counters, one for increments and decrements
string | $type | |
int | $delta | Delta (positive or negative) |
Definition at line 238 of file SiteStatsUpdate.php.
References $type, and(), and getTypeCacheKey().
Referenced by doUpdatePendingDeltas().
|
protected |
string | &$sql | |
string | $field | |
int | $delta |
Definition at line 209 of file SiteStatsUpdate.php.
References and().
Referenced by tryDBUpdateInternal().
|
static |
IDatabase | $dbw |
Definition at line 150 of file SiteStatsUpdate.php.
References $dbr, $services, and(), DB_REPLICA, RC_EXTERNAL, SiteStats\unload(), and Wikimedia\Rdbms\IDatabase\update().
SiteStatsUpdate::doUpdate | ( | ) |
Perform the actual work.
Implements DeferrableUpdate.
Definition at line 84 of file SiteStatsUpdate.php.
References and(), doUpdateContextStats(), and doUpdatePendingDeltas().
|
protected |
Definition at line 186 of file SiteStatsUpdate.php.
Referenced by doUpdate().
|
protected |
Definition at line 196 of file SiteStatsUpdate.php.
References adjustPending(), edits, and pages.
Referenced by doUpdate(), and tryDBUpdateInternal().
|
static |
array | $deltas |
Definition at line 66 of file SiteStatsUpdate.php.
References and().
Referenced by MediaWiki\Storage\DerivedPageDataUpdater\doUpdates().
|
protected |
Get pending delta counters for each stat type.
Definition at line 253 of file SiteStatsUpdate.php.
Referenced by tryDBUpdateInternal().
|
private |
BagOStuff | $stash | |
string | $type | |
string | $sign | ('+' or '-') |
Definition at line 228 of file SiteStatsUpdate.php.
References $type, and BagOStuff\makeKey().
Referenced by adjustPending(), and removePendingDeltas().
SiteStatsUpdate::merge | ( | MergeableUpdate | $update | ) |
Merge this update with $update.
MergeableUpdate | $update | Update of the same class type |
Implements MergeableUpdate.
Definition at line 53 of file SiteStatsUpdate.php.
|
protected |
Reduce pending delta counters after updates have been applied.
array | $pd | Result of getPendingDeltas(), used for DB update |
Definition at line 277 of file SiteStatsUpdate.php.
References $type, and getTypeCacheKey().
Referenced by tryDBUpdateInternal().
SiteStatsUpdate::tryDBUpdateInternal | ( | ) |
Do not call this outside of SiteStatsUpdate.
Definition at line 101 of file SiteStatsUpdate.php.
References $services, appendUpdate(), DB_MASTER, doUpdatePendingDeltas(), edits, getPendingDeltas(), pages, removePendingDeltas(), and SiteStats\unload().
|
protected |
Definition at line 35 of file SiteStatsUpdate.php.
Definition at line 41 of file SiteStatsUpdate.php.
|
protected |
Definition at line 31 of file SiteStatsUpdate.php.
|
protected |
Definition at line 39 of file SiteStatsUpdate.php.
|
protected |
Definition at line 33 of file SiteStatsUpdate.php.
|
protected |
Definition at line 29 of file SiteStatsUpdate.php.
|
protected |
Definition at line 37 of file SiteStatsUpdate.php.