Commit graph

16 commits

Author SHA1 Message Date
Bartosz Dziewoński
485f66f174 Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenient
Find: /isset\(\s*([^()]+?)\s*\)\s*\?\s*\1\s*:\s*/
Replace with: '\1 ?? '

(Everywhere except includes/PHPVersionCheck.php)
(Then, manually fix some line length and indentation issues)

Then manually reviewed the replacements for cases where confusing
operator precedence would result in incorrect results
(fixing those in I478db046a1cc162c6767003ce45c9b56270f3372).

Change-Id: I33b421c8cb11cdd4ce896488c9ff5313f03a38cf
2018-05-30 18:06:13 -07:00
James D. Forrester
9635dda73a includes: Replace implicit Bugzilla bug numbers with Phab ones
It's unreasonable to expect newbies to know that "bug 12345" means "Task T14345"
except where it doesn't, so let's just standardise on the real numbers.

Change-Id: I6f59febaf8fc96e80f8cfc11f4356283f461142a
2017-02-21 18:13:24 +00:00
Kunal Mehta
61adc1e146 Use namespaced ScopedCallback
The un-namespaced \ScopedCallback is deprecated.

Change-Id: Ie014d5a775ead66335a24acac9d339915884d1a4
2016-10-17 15:46:05 -07:00
Gergő Tisza
7ba1936408 Remove unnecessary annotation
Since I8a6588209647252a4509078aaa7bf0cb1d9d299a those variables
are not unused anymore.

Change-Id: Id99581083c9194411051050ed70d4bf4d0664e47
2016-05-16 11:46:07 +00:00
umherirrender
932c37e3cb Use english messages for background use of Status::getWikiText
Status::getWikiText is used for internal logging, api error messages and
maintenance scripts. All this places are usually in english, so pass an
english language to getWikiText.

Change-Id: I3010fca8eb5740a3a851c55a8b12e171714c78f7
2016-04-12 20:01:44 +02:00
jenkins-bot
d716155c8b Merge "Reset scoped session for upload jobs after deferred updates" 2016-03-01 11:30:55 +00:00
Aaron Schulz
1ac63f1767 Reset scoped session for upload jobs after deferred updates
Bug: T126450
Change-Id: I8a6588209647252a4509078aaa7bf0cb1d9d299a
2016-02-24 10:54:31 -08:00
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00
Bartosz Dziewoński
05c2c65ab9 Allow users to tag file uploads
Using either action=upload API or Special:Upload. (No user interface
is provided for the latter, this is meant to be used by on-wiki
scripts/gadgets enhancing the upload process.)

Modelled after how ae3ab9eef0
implemented tagging of regular edits.

Bug: T121876
Change-Id: Ia3e0dbd895b2f8bc66985b24db35f112b6f9a22d
2016-02-16 03:51:29 +01:00
Aaron Schulz
95ec2c32e6 Fix AssembleUploadChunksJob/PublishStashedFileJob IDEA errors
* Use getMessage() on the Exception objects
* Use a dummy WebRequestUpload to pass to continueChunks()
  instead of an object of a completely wrong type

Change-Id: I01ec5c141a6f37ee425af3236d728b9128b98522
2015-10-06 13:50:04 -07:00
Aaron Schulz
9632223e4c Fixed Job constructor IDE notices about variable types
Change-Id: I4b4e4e38e8d416c3445c52ced311f5fbfcde868a
2015-05-30 08:09:30 +00:00
Aaron Schulz
8e3721a2b9 Added EnqueueJob class that handles routing jobs to queues
Bug: T89308
Change-Id: Iadb34f24d8bbe94c0f9f119e530c0bbe1060df0a
2015-03-04 13:55:54 -08:00
Aaron Schulz
6921770414 Updated some try-catch statements: MWException -> Exception
Change-Id: I76601a86e30f4984e3b1a8c8ec5ef5a0f652433a
2015-01-09 17:20:22 -08:00
Aaron Schulz
c7844017c0 Made upload jobs avoid using the user session
* This causes problems with some session handlers and it is
  also trickier to deal with in non CLI script without leaking
  cookie headers.

Change-Id: Iaf2a57f9299e42a5f68bf85115e62e88fa0f8ed6
2014-09-29 16:35:59 -07:00
Brian Wolff
eef642ef1d Make chunked upload jobs robust in face of exceptions.
If an exception occurs when creating the new image page during
PublishStashedFile (for example, if ExternalStorage servers
become overloaded), the job is aborted, but the current
transaction is not aborted. Then the next job comes along, does
$dbw->begin(), which implicitly commits the current open
transactions, causing database corruption (entries in page table
with page_latest = 0).

This patch ensures that if some unknown exception occurs during
the job, that the database gets rolled back to a known good state.

I also plan to make a separate patch to make the recordUpload
code handle exceptions properly. Nonetheless, I think its
important that the general job code be as robust as possible.

Bug: 32551
Change-Id: Icb5e06e81700e5dcf0d4e739c7b2bb3221e718b8
2014-04-05 23:15:26 -03:00
Aaron Schulz
9ffd4f085d Renamed /job to /jobqueue
Change-Id: I4c8a2b42140630838867c77a70d45ba14b5d95e2
2014-03-14 13:42:04 -07:00
Renamed from includes/job/jobs/PublishStashedFileJob.php (Browse further)