Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\Hooks\ArticleRevisionVisibilitySetHookHandler Class Reference

Hook handler that propagates changes to the visibility of an article's revisions to clients. More...

+ Inheritance diagram for Wikibase\Repo\Hooks\ArticleRevisionVisibilitySetHookHandler:
+ Collaboration diagram for Wikibase\Repo\Hooks\ArticleRevisionVisibilitySetHookHandler:

Public Member Functions

 __construct (RevisionLookup $revisionLookup, EntityContentFactory $entityContentFactory, EntityNamespaceLookup $entityNamespaceLookup, TitleFactory $titleFactory, array $localClientDatabases, callable $jobQueueGroupFactory, bool $propagateChangeVisibility, int $clientRCMaxAge, int $jobBatchSize)
 

Static Public Member Functions

static newFromGlobalState ()
 

Private Member Functions

 getEligibleRevisionsById (array $ids)
 Gets all revisions with the given ids and returns those that are relevant (=> no older than self::clientRCMaxAge).
 
 getRepoRevisionIdentifiers (array $revisions)
 
 newRepoRevisionIdentifier (RevisionRecord $revision)
 
 getRevisionAge (RevisionRecord $revision)
 
 newJobQueueGroup (string $wikiId)
 
 revisionIdentifiersToJson (array $revisionIdentifiers)
 JSON encode the given RepoRevisionIdentifiers.
 
 createJobSpecification (string $revisionIdentifiersJson, int $visibilityBitFlag)
 Returns a new job for updating a client.
 

Private Attributes

 $revisionLookup
 
 $entityContentFactory
 
 $entityNamespaceLookup
 
 $titleFactory
 
 $localClientDatabases
 
 $propagateChangeVisibility
 
 $clientRCMaxAge
 
 $jobBatchSize
 
 $jobQueueGroupFactory
 

Detailed Description

Hook handler that propagates changes to the visibility of an article's revisions to clients.

This schedules "ChangeVisibilityNotification" jobs on all client wikis (all as some wikis might no longer be subscribed) which will handle this on the clients.

Author
Marius Hoch

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Hooks\ArticleRevisionVisibilitySetHookHandler::__construct ( RevisionLookup  $revisionLookup,
EntityContentFactory  $entityContentFactory,
EntityNamespaceLookup  $entityNamespaceLookup,
TitleFactory  $titleFactory,
array  $localClientDatabases,
callable  $jobQueueGroupFactory,
bool  $propagateChangeVisibility,
int  $clientRCMaxAge,
int  $jobBatchSize 
)

Member Function Documentation

◆ createJobSpecification()

Wikibase\Repo\Hooks\ArticleRevisionVisibilitySetHookHandler::createJobSpecification ( string  $revisionIdentifiersJson,
int  $visibilityBitFlag 
)
private

Returns a new job for updating a client.

Parameters
string$revisionIdentifiersJson
int$visibilityBitFlag
Returns
IJobSpecification

◆ getEligibleRevisionsById()

Wikibase\Repo\Hooks\ArticleRevisionVisibilitySetHookHandler::getEligibleRevisionsById ( array  $ids)
private

Gets all revisions with the given ids and returns those that are relevant (=> no older than self::clientRCMaxAge).

Parameters
int[]$ids
Returns
RevisionRecord[] Indexed by revision id

◆ getRepoRevisionIdentifiers()

Wikibase\Repo\Hooks\ArticleRevisionVisibilitySetHookHandler::getRepoRevisionIdentifiers ( array  $revisions)
private
Parameters
RevisionRecord[]$revisions
Returns
RepoRevisionIdentifier[]

◆ getRevisionAge()

Wikibase\Repo\Hooks\ArticleRevisionVisibilitySetHookHandler::getRevisionAge ( RevisionRecord  $revision)
private
Parameters
RevisionRecord$revision
Returns
int Age of the revision in seconds

◆ newFromGlobalState()

static Wikibase\Repo\Hooks\ArticleRevisionVisibilitySetHookHandler::newFromGlobalState ( )
static

◆ newJobQueueGroup()

Wikibase\Repo\Hooks\ArticleRevisionVisibilitySetHookHandler::newJobQueueGroup ( string  $wikiId)
private
Parameters
string$wikiId
Returns
JobQueueGroup

◆ newRepoRevisionIdentifier()

Wikibase\Repo\Hooks\ArticleRevisionVisibilitySetHookHandler::newRepoRevisionIdentifier ( RevisionRecord  $revision)
private
Parameters
RevisionRecord$revision
Returns
RepoRevisionIdentifier|null

◆ revisionIdentifiersToJson()

Wikibase\Repo\Hooks\ArticleRevisionVisibilitySetHookHandler::revisionIdentifiersToJson ( array  $revisionIdentifiers)
private

JSON encode the given RepoRevisionIdentifiers.

Parameters
RepoRevisionIdentifier[]$revisionIdentifiers
Returns
string JSON

Member Data Documentation

◆ $clientRCMaxAge

Wikibase\Repo\Hooks\ArticleRevisionVisibilitySetHookHandler::$clientRCMaxAge
private

◆ $entityContentFactory

Wikibase\Repo\Hooks\ArticleRevisionVisibilitySetHookHandler::$entityContentFactory
private

◆ $entityNamespaceLookup

Wikibase\Repo\Hooks\ArticleRevisionVisibilitySetHookHandler::$entityNamespaceLookup
private

◆ $jobBatchSize

Wikibase\Repo\Hooks\ArticleRevisionVisibilitySetHookHandler::$jobBatchSize
private

◆ $jobQueueGroupFactory

Wikibase\Repo\Hooks\ArticleRevisionVisibilitySetHookHandler::$jobQueueGroupFactory
private

◆ $localClientDatabases

Wikibase\Repo\Hooks\ArticleRevisionVisibilitySetHookHandler::$localClientDatabases
private

◆ $propagateChangeVisibility

Wikibase\Repo\Hooks\ArticleRevisionVisibilitySetHookHandler::$propagateChangeVisibility
private

◆ $revisionLookup

Wikibase\Repo\Hooks\ArticleRevisionVisibilitySetHookHandler::$revisionLookup
private

◆ $titleFactory

Wikibase\Repo\Hooks\ArticleRevisionVisibilitySetHookHandler::$titleFactory
private

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