MediaWiki  1.23.8
JobQueueAggregator.php
Go to the documentation of this file.
1 <?php
30 abstract class JobQueueAggregator {
32  protected static $instance = null;
33 
37  protected function __construct( array $params ) {
38  }
39 
44  final public static function singleton() {
45  global $wgJobQueueAggregator;
46 
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  }
55 
56  return self::$instance;
57  }
58 
64  final public static function destroySingleton() {
65  self::$instance = null;
66  }
67 
75  final public function notifyQueueEmpty( $wiki, $type ) {
76  wfProfileIn( __METHOD__ );
77  $ok = $this->doNotifyQueueEmpty( $wiki, $type );
78  wfProfileOut( __METHOD__ );
79 
80  return $ok;
81  }
82 
86  abstract protected function doNotifyQueueEmpty( $wiki, $type );
87 
95  final public function notifyQueueNonEmpty( $wiki, $type ) {
96  wfProfileIn( __METHOD__ );
97  $ok = $this->doNotifyQueueNonEmpty( $wiki, $type );
98  wfProfileOut( __METHOD__ );
99 
100  return $ok;
101  }
102 
106  abstract protected function doNotifyQueueNonEmpty( $wiki, $type );
107 
113  final public function getAllReadyWikiQueues() {
114  wfProfileIn( __METHOD__ );
115  $res = $this->doGetAllReadyWikiQueues();
116  wfProfileOut( __METHOD__ );
117 
118  return $res;
119  }
120 
124  abstract protected function doGetAllReadyWikiQueues();
125 
131  final public function purge() {
132  wfProfileIn( __METHOD__ );
133  $res = $this->doPurge();
134  wfProfileOut( __METHOD__ );
135 
136  return $res;
137  }
138 
142  abstract protected function doPurge();
143 
150  protected function findPendingWikiQueues() {
151  global $wgLocalDatabases;
152 
153  $pendingDBs = array(); // (job type => (db list))
154  foreach ( $wgLocalDatabases as $db ) {
155  foreach ( JobQueueGroup::singleton( $db )->getQueuesWithJobs() as $type ) {
156  $pendingDBs[$type][] = $db;
157  }
158  }
159 
160  return $pendingDBs;
161  }
162 }
JobQueueAggregator\doNotifyQueueNonEmpty
doNotifyQueueNonEmpty( $wiki, $type)
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
JobQueueAggregator\purge
purge()
Purge all of the aggregator information.
Definition: JobQueueAggregator.php:131
JobQueueAggregator\__construct
__construct(array $params)
Definition: JobQueueAggregator.php:37
wfProfileIn
wfProfileIn( $functionname)
Begin profiling of a function.
Definition: Profiler.php:33
JobQueueAggregator\notifyQueueNonEmpty
notifyQueueNonEmpty( $wiki, $type)
Mark a queue as being non-empty.
Definition: JobQueueAggregator.php:95
$params
$params
Definition: styleTest.css.php:40
JobQueueAggregator\destroySingleton
static destroySingleton()
Destroy the singleton instance.
Definition: JobQueueAggregator.php:64
JobQueueAggregator
Class to handle tracking information about all queues.
Definition: JobQueueAggregator.php:30
MWException
MediaWiki exception.
Definition: MWException.php:26
JobQueueAggregator\getAllReadyWikiQueues
getAllReadyWikiQueues()
Get the list of all of the queues with jobs.
Definition: JobQueueAggregator.php:113
JobQueueAggregator\doGetAllReadyWikiQueues
doGetAllReadyWikiQueues()
JobQueueAggregator\notifyQueueEmpty
notifyQueueEmpty( $wiki, $type)
Mark a queue as being empty.
Definition: JobQueueAggregator.php:75
wfProfileOut
wfProfileOut( $functionname='missing')
Stop profiling of a function.
Definition: Profiler.php:46
JobQueueAggregator\doNotifyQueueEmpty
doNotifyQueueEmpty( $wiki, $type)
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
$ok
$ok
Definition: UtfNormalTest.php:71
JobQueueAggregator\doPurge
doPurge()
JobQueueAggregator\findPendingWikiQueues
findPendingWikiQueues()
Get all databases that have a pending job.
Definition: JobQueueAggregator.php:150
JobQueueGroup\singleton
static singleton( $wiki=false)
Definition: JobQueueGroup.php:61
JobQueueAggregator\$instance
static $instance
Definition: JobQueueAggregator.php:32
as
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
Definition: distributors.txt:9
$res
$res
Definition: database.txt:21
JobQueueAggregator\singleton
static singleton()
Definition: JobQueueAggregator.php:44
$type
$type
Definition: testCompression.php:46