Go to the documentation of this file.
62 $this->
wiki = $params[
'wiki'];
63 $this->
type = $params[
'type'];
64 $this->claimTTL = isset(
$params[
'claimTTL'] ) ?
$params[
'claimTTL'] : 0;
65 $this->maxTries = isset(
$params[
'maxTries'] ) ?
$params[
'maxTries'] : 3;
67 $this->
order = $params[
'order'];
72 throw new MWException( __CLASS__ .
" does not support '{$this->order}' order." );
74 $this->checkDelay = !empty(
$params[
'checkDelay'] );
76 throw new MWException( __CLASS__ .
" does not support delayed jobs." );
114 if ( !class_exists( $class ) ) {
115 throw new MWException(
"Invalid job queue class '$class'." );
118 if ( !( $obj instanceof
self ) ) {
119 throw new MWException(
"Class '$class' is not a " . __CLASS__ .
" class." );
189 final public function isEmpty() {
212 final public function getSize() {
310 final public function push( $jobs,
$flags = 0 ) {
325 if ( !count( $jobs ) ) {
329 foreach ( $jobs
as $job ) {
332 "Got '{$job->getType()}' job; expected a '{$this->type}' job." );
335 "Got delayed '{$job->getType()}' job; delays are not supported." );
362 final public function pop() {
366 throw new MWException(
"Cannot pop '{$this->type}' job off foreign wiki queue." );
367 } elseif ( !isset( $wgJobClasses[$this->
type] ) ) {
369 throw new MWException(
"Unrecognized job type '{$this->type}'." );
393 abstract protected function doPop();
407 throw new MWException(
"Got '{$job->getType()}' job; expected '{$this->type}'." );
456 throw new MWException(
"Got '{$job->getType()}' job; expected '{$this->type}'." );
472 if ( !
$job->hasRootJobParams() ) {
473 throw new MWException(
"Cannot register root job; missing parameters." );
501 throw new MWException(
"Got '{$job->getType()}' job; expected '{$this->type}'." );
516 if ( !
$job->hasRootJobParams() ) {
546 final public function delete() {
560 throw new MWException(
"This method is not implemented." );
598 foreach ( $tasks
as $name => &$def ) {
599 $def[
'name'] =
$name;
650 return new ArrayIterator(
array() );
724 if (
$wiki !==
null ) {
737 throw new MWException(
"Queue namespacing not supported for this queue type." );
isEmpty()
Quickly check if the queue has no available (unacquired, non-delayed) jobs.
setTestingPrefix( $key)
Namespace the queue with a key to isolate it for testing.
deduplicateRootJob(Job $job)
Register the "root job" of a given job into the queue for de-duplication.
optimalOrder()
Get the default queue order to use if configuration does not specify one.
getAllDelayedJobs()
Get an iterator to traverse over all delayed jobs in this queue.
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
static incrStats( $key, $type, $delta=1, $wiki=null)
Call wfIncrStats() for the queue overall and for the queue type.
int $claimTTL
Time to live in seconds *.
batchPush(array $jobs, $flags=0)
Push a batch of jobs into the queue.
Prior to maintenance scripts were a hodgepodge of code that had no cohesion or formal method of action Beginning maintenance scripts have been cleaned up to use a unified class Directory structure How to run a script How to write your own DIRECTORY STRUCTURE The maintenance directory of a MediaWiki installation contains several all of which have unique purposes HOW TO RUN A SCRIPT Ridiculously just call php someScript php that s in the top level maintenance directory if not default wiki
wfProfileIn( $functionname)
Begin profiling of a function.
doGetSiblingQueuesWithJobs(array $types)
wfGetCache( $inputType)
Get a cache object.
interface is intended to be more or less compatible with the PHP memcached client.
wfSplitWikiID( $wiki)
Split a wiki ID into DB name and table prefix.
it s the revision text itself In either if gzip is the revision text is gzipped $flags
doBatchPush(array $jobs, $flags)
bool $checkDelay
Allow delayed jobs *.
push( $jobs, $flags=0)
Push one or more jobs into the queue.
getAbandonedCount()
Get the number of acquired jobs that can no longer be attempted.
Class to both describe a background job and handle jobs.
doDeduplicateRootJob(Job $job)
Class for handling function-scope profiling.
getAcquiredCount()
Get the number of acquired jobs (these are temporarily out of the queue).
doGetSiblingQueueSizes(array $types)
wfIncrStats( $key, $count=1)
Increment a statistics counter.
ack(Job $job)
Acknowledge that a job was completed.
doIsRootJobOldDuplicate(Job $job)
supportedOrders()
Get the allowed queue orders for configuration validation.
wfProfileOut( $functionname='missing')
Stop profiling of a function.
getDelayedCount()
Get the number of delayed jobs (these are temporarily out of the queue).
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
when a variable name is used in a it is silently declared as a new masking the global
wfForeignMemcKey( $db, $prefix)
Get a cache key for a foreign DB.
static newFromJob(Job $job)
Get a duplicate no-op version of a job.
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
getSize()
Get the number of available (unacquired, non-delayed) jobs in the queue.
getAllQueuedJobs()
Get an iterator to traverse over all available jobs in this queue.
wfWikiID()
Get an ASCII string identifying this wiki This is used as a prefix in memcached keys.
Allows to change the fields on the form that will be generated $name
waitForBackups()
Wait for any slaves or backup servers to catch up.
static factory(array $params)
Get a job queue object of the specified type.
supportsDelayedJobs()
Find out if delayed jobs are supported for configuration validation.
string $order
Job priority for pop() *.
getRootJobCacheKey( $signature)
This document describes the state of Postgres support in and is fairly well maintained The main code is very well while extensions are very hit and miss it is probably the most supported database after MySQL Much of the work in making MediaWiki database agnostic came about through the work of creating Postgres as and are nearing end of but without copying over all the usage comments General notes on the but these can almost always be programmed around *Although Postgres has a true BOOLEAN type
if(count( $args)< 1) $job
flushCaches()
Clear any process and persistent caches.
int $maxTries
Maximum number of times to try a job *.
pop()
Pop a job off of the queue.
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
Class to handle enqueueing and running of background jobs.
getCoalesceLocationInternal()
Do not use this function outside of JobQueue/JobQueueGroup.
isRootJobOldDuplicate(Job $job)
Check if the "root" job of a given job has been superseded by a newer one.
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add in any order
getSiblingQueueSizes(array $types)
Check the size of each of the given queues.
getSiblingQueuesWithJobs(array $types)
Check whether each of the given queues are empty.
__construct(array $params)
getPeriodicTasks()
Return a map of task names to task definition maps.