MediaWiki  REL1_22
SiteStatsUpdate Class Reference

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

Inheritance diagram for SiteStatsUpdate:
Collaboration diagram for SiteStatsUpdate:

List of all members.

Public Member Functions

 __construct ($views, $edits, $good, $pages=0, $users=0)
 doUpdate ()
 Perform the actual work.
 tryDBUpdateInternal ()
 Do not call this outside of SiteStatsUpdate.

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)

Detailed Description

Class for handling updates to the site_stats table.

Definition at line 257 of file SiteStats.php.


Constructor & Destructor Documentation

SiteStatsUpdate::__construct ( views,
edits,
good,
pages = 0,
users = 0 
)

Definition at line 266 of file SiteStats.php.

References $edits, $pages, $users, $views, edits, and pages.


Member Function Documentation

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

Parameters:
$typestring
$deltainteger Delta (positive or negative)
Returns:
void

Definition at line 425 of file SiteStats.php.

References $key, $wgMemc, getTypeCacheKey(), and global.

Referenced by doUpdatePendingDeltas().

SiteStatsUpdate::appendUpdate ( &$  sql,
field,
delta 
) [protected]
Parameters:
$sqlstring
$fieldstring
$deltainteger

Definition at line 396 of file SiteStats.php.

Referenced by tryDBUpdateInternal().

static SiteStatsUpdate::cacheUpdate ( dbw) [static]
Parameters:
$dbwDatabaseBase
Returns:
bool|mixed

Definition at line 357 of file SiteStats.php.

References $dbr, array(), global, wfGetDB(), and wfTimestamp().

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

Perform the actual work.

Implements DeferrableUpdate.

Definition at line 291 of file SiteStats.php.

References array(), doUpdatePendingDeltas(), global, and wfGetDB().

Definition at line 382 of file SiteStats.php.

References adjustPending(), edits, and pages.

Referenced by doUpdate(), and tryDBUpdateInternal().

static SiteStatsUpdate::factory ( array deltas) [static]
Parameters:
$deltasArray
Returns:
SiteStatsUpdate

Definition at line 278 of file SiteStats.php.

References array(), and as.

Get pending delta counters for each stat type.

Returns:
Array Positive and negative deltas for each type
void

Definition at line 447 of file SiteStats.php.

References $wgMemc, array(), as, and global.

Referenced by tryDBUpdateInternal().

SiteStatsUpdate::getTypeCacheKey ( type,
sign 
) [private]
Parameters:
$typestring
string$sign('+' or '-')
Returns:
string

Definition at line 414 of file SiteStats.php.

References wfMemcKey().

Referenced by adjustPending(), and removePendingDeltas().

Reduce pending delta counters after updates have been applied.

Parameters:
array$pdResult of getPendingDeltas(), used for DB update
Returns:
void

Definition at line 467 of file SiteStats.php.

References $wgMemc, as, getTypeCacheKey(), and global.

Referenced by tryDBUpdateInternal().


Member Data Documentation

SiteStatsUpdate::$articles = 0 [protected]

Definition at line 261 of file SiteStats.php.

SiteStatsUpdate::$edits = 0 [protected]

Definition at line 259 of file SiteStats.php.

Referenced by __construct().

SiteStatsUpdate::$images = 0 [protected]

Definition at line 263 of file SiteStats.php.

SiteStatsUpdate::$pages = 0 [protected]

Definition at line 260 of file SiteStats.php.

Referenced by __construct().

SiteStatsUpdate::$users = 0 [protected]

Definition at line 262 of file SiteStats.php.

Referenced by __construct().

SiteStatsUpdate::$views = 0 [protected]

Definition at line 258 of file SiteStats.php.

Referenced by __construct().


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