45 foreach ( $jobs
as $job ) {
46 if ( $job->ignoreDuplicates() ) {
47 $sha1 = Wikimedia\base_convert(
48 sha1(
serialize( $job->getDeduplicationInfo() ) ),
51 if ( !isset( $unclaimed[$sha1] ) ) {
52 $unclaimed[$sha1] =
$job;
66 return [
'random',
'timestamp',
'fifo' ];
95 return $unclaimed ? count( $unclaimed ) : 0;
106 return $claimed ? count( $claimed ) : 0;
122 if ( $this->
order ===
'random' ) {
123 $key = array_rand( $unclaimed );
126 $key =
key( $unclaimed );
129 $spec = $unclaimed[$key];
130 unset( $unclaimed[$key] );
136 $job->metadata[
'claimId'] =
key( $claimed );
152 unset( $claimed[$job->metadata[
'claimId']] );
159 if ( isset( self::$data[$this->
type][$this->
wiki] ) ) {
160 unset( self::$data[$this->
type][$this->wiki] );
161 if ( !self::$data[$this->
type] ) {
162 unset( self::$data[$this->type] );
175 return new ArrayIterator( [] );
194 return new ArrayIterator( [] );
221 if ( !isset( self::$data[$this->
type][$this->
wiki][$field] ) ) {
222 if ( $init !== null ) {
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
the array() calling protocol came about after MediaWiki 1.4rc1.
Class to both describe a background job and handle jobs.
it s the revision text itself In either if gzip is the revision text is gzipped $flags
& getQueueData($field, $init=null)
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
jobFromSpecInternal(IJobSpecification $spec)
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 and then calling but I prefer the flexibility This should also do the output encoding The system allocates a global one in $wgOut Title Represents the title of an and does all the work of translating among various forms such as plain database key
getAcquiredCount()
Get the number of acquired jobs (these are temporarily out of the queue).
Convenience class for generating iterators from iterators.
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
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
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
static factory($command, Title $title, $params=[])
Create the appropriate object to handle a specific job.
Class to handle job queues stored in PHP memory for testing.
Class to handle enqueueing and running of background jobs.
Job queue task description interface.
doBatchPush(array $jobs, $flags)