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. | |
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. | |
appendUpdate (&$sql, $field, $delta) | |
doUpdatePendingDeltas () | |
getPendingDeltas () | |
Get pending delta counters for each stat type. | |
removePendingDeltas (array $pd) | |
Reduce pending delta counters after updates have been applied. | |
Protected Attributes | |
$articles = 0 | |
$edits = 0 | |
$images = 0 | |
$pages = 0 | |
$users = 0 | |
$views = 0 | |
Private Member Functions | |
getTypeCacheKey ($type, $sign) |
Class for handling updates to the site_stats table.
Definition at line 253 of file SiteStats.php.
SiteStatsUpdate::__construct | ( | $ | views, |
$ | edits, | ||
$ | good, | ||
$ | pages = 0 , |
||
$ | users = 0 |
||
) |
SiteStatsUpdate::adjustPending | ( | $ | type, |
$ | delta | ||
) | [protected] |
Adjust the pending deltas for a stat type.
Each stat type has two pending counters, one for increments and decrements
$type | string |
$delta | integer Delta (positive or negative) |
Definition at line 414 of file SiteStats.php.
References $wgMemc, getTypeCacheKey(), and global.
Referenced by doUpdatePendingDeltas().
SiteStatsUpdate::appendUpdate | ( | &$ | sql, |
$ | field, | ||
$ | delta | ||
) | [protected] |
$sql | string |
$field | string |
$delta | integer |
Definition at line 385 of file SiteStats.php.
Referenced by doUpdate().
static SiteStatsUpdate::cacheUpdate | ( | $ | dbw | ) | [static] |
$dbw | DatabaseBase |
Definition at line 346 of file SiteStats.php.
References $dbr, array(), global, and wfGetDB().
Referenced by SiteStatsInit\doAllAndCommit(), SpecialStatistics\execute(), and InitStats\execute().
Perform the actual work.
Implements DeferrableUpdate.
Definition at line 287 of file SiteStats.php.
References appendUpdate(), array(), doUpdatePendingDeltas(), edits, getPendingDeltas(), global, pages, removePendingDeltas(), wfGetDB(), and wfMemcKey().
SiteStatsUpdate::doUpdatePendingDeltas | ( | ) | [protected] |
Definition at line 371 of file SiteStats.php.
References adjustPending(), edits, and pages.
Referenced by doUpdate().
static SiteStatsUpdate::factory | ( | array $ | deltas | ) | [static] |
SiteStatsUpdate::getPendingDeltas | ( | ) | [protected] |
Get pending delta counters for each stat type.
Definition at line 436 of file SiteStats.php.
References $wgMemc, array(), as, and global.
Referenced by doUpdate().
SiteStatsUpdate::getTypeCacheKey | ( | $ | type, |
$ | sign | ||
) | [private] |
$type | string |
$sign | string ('+' or '-') |
Definition at line 403 of file SiteStats.php.
References wfMemcKey().
Referenced by adjustPending(), and removePendingDeltas().
SiteStatsUpdate::removePendingDeltas | ( | array $ | pd | ) | [protected] |
Reduce pending delta counters after updates have been applied.
Array | $pd | Result of getPendingDeltas(), used for DB update |
Definition at line 456 of file SiteStats.php.
References $wgMemc, as, getTypeCacheKey(), and global.
Referenced by doUpdate().
SiteStatsUpdate::$articles = 0 [protected] |
Definition at line 257 of file SiteStats.php.
SiteStatsUpdate::$edits = 0 [protected] |
Definition at line 255 of file SiteStats.php.
Referenced by __construct().
SiteStatsUpdate::$images = 0 [protected] |
Definition at line 259 of file SiteStats.php.
SiteStatsUpdate::$pages = 0 [protected] |
Definition at line 256 of file SiteStats.php.
Referenced by __construct().
SiteStatsUpdate::$users = 0 [protected] |
Definition at line 258 of file SiteStats.php.
Referenced by __construct().
SiteStatsUpdate::$views = 0 [protected] |
Definition at line 254 of file SiteStats.php.
Referenced by __construct().