/**
* Find the number of users in a given user group.
- * @param $group String: name of group
+ * @param string $group name of group
* @return Integer
*/
static function numberingroup( $group ) {
$this->doUpdatePendingDeltas();
} else {
$dbw = wfGetDB( DB_MASTER );
- // Need a separate transaction because this a global lock
- $dbw->begin( __METHOD__ );
$lockKey = wfMemcKey( 'site_stats' ); // prepend wiki ID
if ( $rate ) {
$this->images += ( $pd['ss_images']['+'] - $pd['ss_images']['-'] );
}
+ // Need a separate transaction because this a global lock
+ $dbw->begin( __METHOD__ );
+
// Build up an SQL query of deltas and apply them...
$updates = '';
$this->appendUpdate( $updates, 'ss_total_views', $this->views );
/**
* @param $type string
- * @param $sign string ('+' or '-')
+ * @param string $sign ('+' or '-')
* @return string
*/
private function getTypeCacheKey( $type, $sign ) {
/**
* Reduce pending delta counters after updates have been applied
- * @param Array $pd Result of getPendingDeltas(), used for DB update
+ * @param array $pd Result of getPendingDeltas(), used for DB update
* @return void
*/
protected function removePendingDeltas( array $pd ) {
* @param $database DatabaseBase|bool
* - Boolean: whether to use the master DB
* - DatabaseBase: database connection to use
- * @param $options Array of options, may contain the following values
+ * @param array $options of options, may contain the following values
* - update Boolean: whether to update the current stats (true) or write fresh (false) (default: false)
* - views Boolean: when true, do not update the number of page views (default: true)
* - activeUsers Boolean: whether to update the number of active users (default: false)