Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\Maintenance\DispatchChanges Class Reference

Maintenance script that polls for Wikibase changes in the shared wb_changes table and dispatches the relevant changes to any client wikis' job queues. More...

+ Inheritance diagram for Wikibase\Repo\Maintenance\DispatchChanges:
+ Collaboration diagram for Wikibase\Repo\Maintenance\DispatchChanges:

Public Member Functions

 __construct ()
 
 execute ()
 Maintenance script entry point.
 
 trace ( $message)
 Log a message if verbose mode is enabled.
 
 log ( $message)
 Log a message unless we are quiet.
 

Private Member Functions

 getClientWikis (array $clientWikis)
 
 filterClientWikis (array $allClientWikis, array $selectedSiteIDs=null)
 
 newChangeDispatcher (array $clientWikis, EntityChangeLookup $changeLookup, SettingsArray $settings, LoggerInterface $logger)
 Initializes members from command line options and configuration settings.
 
 getCoordinator (SettingsArray $settings, LoggerInterface $logger)
 Find and return the proper ChangeDispatchCoordinator.
 

Private Attributes

 $verbose
 

Detailed Description

Maintenance script that polls for Wikibase changes in the shared wb_changes table and dispatches the relevant changes to any client wikis' job queues.

Author
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Maintenance\DispatchChanges::__construct ( )

Member Function Documentation

◆ execute()

Wikibase\Repo\Maintenance\DispatchChanges::execute ( )

Maintenance script entry point.

This will run $this->runPass() in a loop, the number of times specified by $this->maxPasses. If $this->maxTime is exceeded before all passes are run, execution is also terminated. If no suitable target wiki can be found for a pass, we sleep for $this->delay seconds instead of dispatching.

◆ filterClientWikis()

Wikibase\Repo\Maintenance\DispatchChanges::filterClientWikis ( array  $allClientWikis,
array  $selectedSiteIDs = null 
)
private
Parameters
string[]$allClientWikisas returned by getClientWikis().
string[] | null$selectedSiteIDssite IDs to select, or null to disable filtering.
Exceptions
MWException
Returns
string[] A mapping of client wiki site IDs to logical database names.

◆ getClientWikis()

Wikibase\Repo\Maintenance\DispatchChanges::getClientWikis ( array  $clientWikis)
private
Parameters
string[]$clientWikisas defined in the localClientDatabases config setting.
Returns
string[] A mapping of client wiki site IDs to logical database names.

◆ getCoordinator()

Wikibase\Repo\Maintenance\DispatchChanges::getCoordinator ( SettingsArray  $settings,
LoggerInterface  $logger 
)
private

Find and return the proper ChangeDispatchCoordinator.

Parameters
SettingsArray$settings
LoggerInterface$logger
Returns
SqlChangeDispatchCoordinator

◆ log()

Wikibase\Repo\Maintenance\DispatchChanges::log (   $message)

Log a message unless we are quiet.

Parameters
string$message

◆ newChangeDispatcher()

Wikibase\Repo\Maintenance\DispatchChanges::newChangeDispatcher ( array  $clientWikis,
EntityChangeLookup  $changeLookup,
SettingsArray  $settings,
LoggerInterface  $logger 
)
private

Initializes members from command line options and configuration settings.

Parameters
string[]$clientWikisA mapping of client wiki site IDs to logical database names.
EntityChangeLookup$changeLookup
SettingsArray$settings
LoggerInterface$logger
Returns
ChangeDispatcher

◆ trace()

Wikibase\Repo\Maintenance\DispatchChanges::trace (   $message)

Log a message if verbose mode is enabled.

Parameters
string$message

Member Data Documentation

◆ $verbose

Wikibase\Repo\Maintenance\DispatchChanges::$verbose
private

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