MediaWiki REL1_37
|
Track info about user edit counts and timings. More...
Public Member Functions | |
__construct (ActorMigration $actorMigration, ILoadBalancer $loadBalancer, JobQueueGroup $jobQueueGroup) | |
clearUserEditCache (UserIdentity $user) | |
getFirstEditTimestamp (UserIdentity $user) | |
Get the user's first edit timestamp. | |
getLatestEditTimestamp (UserIdentity $user) | |
Get the user's latest edit timestamp. | |
getUserEditCount (UserIdentity $user) | |
Get a user's edit count from the user_editcount field, falling back to initialize. | |
incrementUserEditCount (UserIdentity $user) | |
Schedule a job to increase a user's edit count. | |
initializeUserEditCount (UserIdentity $user) | |
setCachedUserEditCount (UserIdentity $user, int $editCount) | |
Private Member Functions | |
getUserEditTimestamp (UserIdentity $user, int $type) | |
Get the timestamp of a user's edit, either their first or latest. | |
Private Attributes | |
ActorMigration | $actorMigration |
JobQueueGroup | $jobQueueGroup |
ILoadBalancer | $loadBalancer |
array | $userEditCountCache = [] |
Mapping of user id to edit count for caching To avoid using non-sequential numerical keys, keys are in the form: u⧼user id⧽ | |
const | FIRST_EDIT = 1 |
const | LATEST_EDIT = 2 |
Track info about user edit counts and timings.
Definition at line 21 of file UserEditTracker.php.
MediaWiki\User\UserEditTracker::__construct | ( | ActorMigration | $actorMigration, |
ILoadBalancer | $loadBalancer, | ||
JobQueueGroup | $jobQueueGroup | ||
) |
ActorMigration | $actorMigration | |
ILoadBalancer | $loadBalancer | |
JobQueueGroup | $jobQueueGroup |
Definition at line 48 of file UserEditTracker.php.
References MediaWiki\User\UserEditTracker\$actorMigration, MediaWiki\User\UserEditTracker\$jobQueueGroup, and MediaWiki\User\UserEditTracker\$loadBalancer.
MediaWiki\User\UserEditTracker::clearUserEditCache | ( | UserIdentity | $user | ) |
UserIdentity | $user |
Definition at line 199 of file UserEditTracker.php.
References MediaWiki\User\UserIdentity\getId(), and MediaWiki\User\UserIdentity\isRegistered().
MediaWiki\User\UserEditTracker::getFirstEditTimestamp | ( | UserIdentity | $user | ) |
Get the user's first edit timestamp.
UserIdentity | $user |
Definition at line 145 of file UserEditTracker.php.
MediaWiki\User\UserEditTracker::getLatestEditTimestamp | ( | UserIdentity | $user | ) |
Get the user's latest edit timestamp.
UserIdentity | $user |
Definition at line 156 of file UserEditTracker.php.
MediaWiki\User\UserEditTracker::getUserEditCount | ( | UserIdentity | $user | ) |
Get a user's edit count from the user_editcount field, falling back to initialize.
UserIdentity | $user |
Definition at line 64 of file UserEditTracker.php.
|
private |
Get the timestamp of a user's edit, either their first or latest.
UserIdentity | $user | |
int | $type | either self::FIRST_EDIT or ::LATEST_EDIT |
Definition at line 167 of file UserEditTracker.php.
References $dbr, $type, DB_REPLICA, and MediaWiki\User\UserIdentity\getId().
MediaWiki\User\UserEditTracker::incrementUserEditCount | ( | UserIdentity | $user | ) |
Schedule a job to increase a user's edit count.
UserIdentity | $user |
Definition at line 126 of file UserEditTracker.php.
References MediaWiki\User\UserIdentity\isRegistered().
MediaWiki\User\UserEditTracker::initializeUserEditCount | ( | UserIdentity | $user | ) |
UserIdentity | $user |
Definition at line 98 of file UserEditTracker.php.
MediaWiki\User\UserEditTracker::setCachedUserEditCount | ( | UserIdentity | $user, |
int | $editCount | ||
) |
UserIdentity | $user | |
int | $editCount |
InvalidArgumentException | If the user is not registered |
Definition at line 216 of file UserEditTracker.php.
References MediaWiki\User\UserIdentity\getId(), and MediaWiki\User\UserIdentity\isRegistered().
|
private |
Definition at line 27 of file UserEditTracker.php.
Referenced by MediaWiki\User\UserEditTracker\__construct().
|
private |
Definition at line 33 of file UserEditTracker.php.
Referenced by MediaWiki\User\UserEditTracker\__construct().
|
private |
Definition at line 30 of file UserEditTracker.php.
Referenced by MediaWiki\User\UserEditTracker\__construct().
|
private |
Mapping of user id to edit count for caching To avoid using non-sequential numerical keys, keys are in the form: u⧼user id⧽
Definition at line 41 of file UserEditTracker.php.
|
private |
Definition at line 23 of file UserEditTracker.php.
|
private |
Definition at line 24 of file UserEditTracker.php.