MediaWiki REL1_28
Go to the documentation of this file.
30abstract class JobQueueAggregator {
32 protected static $instance = null;
37 public function __construct( array $params ) {
38 }
44 final public static function singleton() {
47 if ( !isset( self::$instance ) ) {
48 $class = $wgJobQueueAggregator['class'];
49 $obj = new $class( $wgJobQueueAggregator );
50 if ( !( $obj instanceof JobQueueAggregator ) ) {
51 throw new MWException( "Class '$class' is not a JobQueueAggregator class." );
52 }
53 self::$instance = $obj;
54 }
56 return self::$instance;
57 }
64 final public static function destroySingleton() {
65 self::$instance = null;
66 }
75 final public function notifyQueueEmpty( $wiki, $type ) {
76 $ok = $this->doNotifyQueueEmpty( $wiki, $type );
78 return $ok;
79 }
84 abstract protected function doNotifyQueueEmpty( $wiki, $type );
93 final public function notifyQueueNonEmpty( $wiki, $type ) {
94 $ok = $this->doNotifyQueueNonEmpty( $wiki, $type );
96 return $ok;
97 }
102 abstract protected function doNotifyQueueNonEmpty( $wiki, $type );
109 final public function getAllReadyWikiQueues() {
110 $res = $this->doGetAllReadyWikiQueues();
112 return $res;
113 }
118 abstract protected function doGetAllReadyWikiQueues();
125 final public function purge() {
126 $res = $this->doPurge();
128 return $res;
129 }
134 abstract protected function doPurge();
142 protected function findPendingWikiQueues() {
145 $pendingDBs = []; // (job type => (db list))
146 foreach ( $wgLocalDatabases as $db ) {
147 foreach ( JobQueueGroup::singleton( $db )->getQueuesWithJobs() as $type ) {
148 $pendingDBs[$type][] = $db;
149 }
150 }
152 return $pendingDBs;
153 }
157 protected function doNotifyQueueEmpty( $wiki, $type ) {
158 return true;
159 }
161 protected function doNotifyQueueNonEmpty( $wiki, $type ) {
162 return true;
163 }
165 protected function doGetAllReadyWikiQueues() {
166 return [];
167 }
169 protected function doPurge() {
170 return true;
171 }
Other wikis on this site, can be administered from a single developer account.
Which aggregator to use for tracking which queues have jobs.
doNotifyQueueNonEmpty( $wiki, $type)
Class to handle tracking information about all queues.
__construct(array $params)
Get the list of all of the queues with jobs.
Get all databases that have a pending job.
notifyQueueNonEmpty( $wiki, $type)
Mark a queue as being non-empty.
static destroySingleton()
Destroy the singleton instance.
doNotifyQueueEmpty( $wiki, $type)
doNotifyQueueNonEmpty( $wiki, $type)
static JobQueueAggregator $instance
Purge all of the aggregator information.
notifyQueueEmpty( $wiki, $type)
Mark a queue as being empty.
static singleton( $wiki=false)
MediaWiki exception.
Definition database.txt:21
when a variable name is used in a it is silently declared as a new local masking the global
Definition design.txt:95
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
the array() calling protocol came about after MediaWiki 1.4rc1.
namespace are movable Hooks may change this value to override the return value of MWNamespace::isMovable(). 'NewDifferenceEngine' do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached one of or reset my talk my contributions etc etc otherwise the built in rate limiting checks are if enabled allows for interception of redirect as a string mapping parameter names to values & $type
Definition hooks.txt:2568
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition injection.txt:37