This comes from factoring done with commit fb69ee4. To add quotes based
on the database type, we actually need a Database instance!
Fault introduced by https://gerrit.wikimedia.org/r/9116
Change-Id: I7a4f7fb1a744cd7adb5166e66424b664edb3d9e8
nextJob.php does not honor jobs types being excluded from the default
job queue by using $wgJobTypesExcludedFromDefaultQueue. Since those jobs
can never get processed, nextJob.php will always return a database which
might produce a nasty infinite loop while trying to process the whole
queue.
Job::pop did take in account wgJobTypesExcludedFromDefaultQueue to
filter the jobs out. So this patch factor out the code in a new method
and uses it for nextJob.php.
Change-Id: I15197ffcca00f229c9004e2abd87e009bc40f384
This supercedes I6d03bf2a, using better names for the new classes and
incorporating the changes requested by Aaron.
This change introduces the base class SecondaryDataUpdate to be used for any
updates that need to be applied when a page is changed or deleted. Until now,
this was done by the LinksUpdate class for updates and WikiPage::doDeletionUpdates
upon deletion. This patch uses a list of SecondaryDataUpdates in both cases.
This allows extensions (e.g. via the ContentHandler facility, once that is in) to
easily specify what needs to be done when a page is updated or deleted in order to
keep any secondary data stores (such as link tables) in sync.
Note that limited transactional logic is also introduced, so SecondaryDataUpdate
can be implemented to only commit their changes if all updates were performed
sucessfully.
Patch Set 2: fixing some coding style issues mentioned by Nikerabbit.
Patch Set 4: some stuff I kept from the old LinksUpdate class needs cleanup,
but might break extensions when changed. Marking as todo for now.
Patch Set 5: fixed misnamed member in LinksDeletionUpdate (thanks Aaron).
Change-Id: Ibe3e88fadd8c1d4063cf13bb6972f2a23569a73f
Designed for administration purposes, not to be exposed to front end users
Useful for administration purposes (like WMF with job runners), we can look at the "highest" jobs, and find out whether enwiki is just busy, or the jobs have been there a while (signalling that the job runners potentially have issues)
* Missed one call to ParserOptions::getUserLang() in Parser
* Also convert RefreshLinksJob and RefreshLinksJob2 to use ParserOptions::newFromUserAndLang() and pass $wgContLang instead of whatever $wgLang could be
* Introduce new hooks which allow BacklinkCache to handle non-core tables
* Make table name a parameter to RefreshLinks2 job (instead of hardcoded templatelinks)
ApiUpload:
* Added "statuskey" parameter; this is the key that is returned by an async upload
* Refactored warnings transformation into its own function
* filename is no longer required on all uploads
UploadFromUrlJob:
* Moved upload results to its own entry in $_SESSION, instead of using the one from upload
* Fix storing in session by calling wfSetupSession and session_write_close where needed
Tests:
* Set $wgUser in ApiSetup, so that individual tests don't have to do this for themselves
* Added tests to cover most code paths from the API
* Fixed UploadFromUrlTestSuite so that its tests are included in a regular phpunit invocation (something strange with the AutoLoader; not sure what)
Other files:
* Allow passing session id to wfSetupSession
* Explicitly close the session before doing jobs, so that jobs can't manipulate the current session
* Use a more specific filename in UploadFromUrlTest and fix some assertions.
* Return boolean from UploadFromUrlJob::run
* Force ignorewarnings and leavemessage in UploadFromUrlJob
Other changes:
* Moved verifyPermissions check in ApiUpload down pending r70135 implementation in the API.
* In User::leaveMessage: append message to end of talk page; add a newline before the heading
* In ApiUpload: moved stuff that is checking instead of actual uploading out of performUpload method
* Made UploadFromUrl conform to standards:
** In initialize* do only initialization, no actual work
** Moved file fetching to fetchFile
** Consistent use of tempnam()
** Perform the uploading in performUpload, don't define our own doUpload method
* Moved almost all job magic to the UploadFromUrlJob class. This way the job is almost a regular client, and we don't need many special cases to deal with async uploading.
* Made leaving a message optional; results will be stored in the session otherwise
I did not actually test the async uploading, because I first wanted to commit a properly working synchronous upload-by-url system.