MediaWiki
master
|
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. More... | |
tryDBUpdateInternal () | |
Do not call this outside of SiteStatsUpdate. More... | |
Static Public Member Functions | |
static | cacheUpdate ($dbw) |
static | factory (array $deltas) |
Protected Member Functions | |
adjustPending ($type, $delta) | |
Adjust the pending deltas for a stat type. More... | |
appendUpdate (&$sql, $field, $delta) | |
doUpdateContextStats () | |
doUpdatePendingDeltas () | |
getPendingDeltas () | |
Get pending delta counters for each stat type. More... | |
removePendingDeltas (array $pd) | |
Reduce pending delta counters after updates have been applied. More... | |
Protected Attributes | |
int | $articles = 0 |
int | $edits = 0 |
int | $images = 0 |
int | $pages = 0 |
int | $users = 0 |
Private Member Functions | |
getTypeCacheKey ($type, $sign) | |
Class for handling updates to the site_stats table.
Definition at line 24 of file SiteStatsUpdate.php.
SiteStatsUpdate::__construct | ( | $views, | |
$edits, | |||
$good, | |||
$pages = 0 , |
|||
$users = 0 |
|||
) |
|
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 209 of file SiteStatsUpdate.php.
References $cache, $type, ObjectCache\getMainStashInstance(), and getTypeCacheKey().
Referenced by doUpdatePendingDeltas().
|
protected |
string | $sql | |
string | $field | |
int | $delta |
Definition at line 181 of file SiteStatsUpdate.php.
Referenced by tryDBUpdateInternal().
|
static |
IDatabase | $dbw |
Definition at line 131 of file SiteStatsUpdate.php.
References $dbr, $wgActiveUserDays, DB_SLAVE, global, TS_UNIX, wfGetDB(), and wfTimestamp().
Referenced by SiteStatsInit\doAllAndCommit(), and InitSiteStats\execute().
SiteStatsUpdate::doUpdate | ( | ) |
Perform the actual work.
Implements DeferrableUpdate.
Definition at line 65 of file SiteStatsUpdate.php.
References $wgSiteStatsAsyncFactor, DeferredUpdates\addCallableUpdate(), doUpdateContextStats(), doUpdatePendingDeltas(), and global.
|
protected |
Definition at line 158 of file SiteStatsUpdate.php.
References $type, as, and RequestContext\getMain().
Referenced by doUpdate().
|
protected |
Definition at line 168 of file SiteStatsUpdate.php.
References adjustPending(), edits, and pages.
Referenced by doUpdate(), and tryDBUpdateInternal().
|
static |
array | $deltas |
Definition at line 52 of file SiteStatsUpdate.php.
References as.
Referenced by LocalFile\delete(), LocalFileRestoreBatch\execute(), WikiImporter\finishImportPage(), and LocalFile\recordUpload2().
|
protected |
Get pending delta counters for each stat type.
Definition at line 225 of file SiteStatsUpdate.php.
References $cache, $type, as, ObjectCache\getMainStashInstance(), and BagOStuff\READ_LATEST.
Referenced by tryDBUpdateInternal().
|
private |
string | $type | |
string | $sign | ('+' or '-') |
Definition at line 199 of file SiteStatsUpdate.php.
References $type, and wfMemcKey().
Referenced by adjustPending(), and removePendingDeltas().
|
protected |
Reduce pending delta counters after updates have been applied.
array | $pd | Result of getPendingDeltas(), used for DB update |
Definition at line 245 of file SiteStatsUpdate.php.
References $cache, $type, as, ObjectCache\getMainStashInstance(), and getTypeCacheKey().
Referenced by tryDBUpdateInternal().
SiteStatsUpdate::tryDBUpdateInternal | ( | ) |
Do not call this outside of SiteStatsUpdate.
Definition at line 84 of file SiteStatsUpdate.php.
References $wgSiteStatsAsyncFactor, appendUpdate(), DB_MASTER, doUpdatePendingDeltas(), edits, getPendingDeltas(), global, pages, removePendingDeltas(), wfGetDB(), and wfMemcKey().
|
protected |
Definition at line 32 of file SiteStatsUpdate.php.
|
protected |
Definition at line 26 of file SiteStatsUpdate.php.
Referenced by __construct().
|
protected |
Definition at line 38 of file SiteStatsUpdate.php.
|
protected |
Definition at line 29 of file SiteStatsUpdate.php.
Referenced by __construct().
|
protected |
Definition at line 35 of file SiteStatsUpdate.php.
Referenced by __construct().