lhc/web/wiklou.git
6 years agoHttp::getProxy() method to get proxy configuration
Sébastien Santoro [Fri, 25 Mar 2016 15:10:19 +0000 (15:10 +0000)]
Http::getProxy() method to get proxy configuration

MediaWiki currently uses two sources for proxy configuration:
* the $wgHTTPProxy global configuration variable
* the http_proxy environment variable

The HTTP proxy adress to use is a valuable information for
extensions handling directly HTTP requests instead of use
helper classes provided by the core to construct them.

This change offers an Http::getProxy() utility method to get
the configuration, regardless of the source.

Bug: T117954
Change-Id: I5df31845df71f05ac581f532cc9bd7a1fea25583

6 years agoLocalisationCache: try harder to use LCStoreCDB
Ori Livneh [Fri, 6 Nov 2015 01:27:47 +0000 (17:27 -0800)]
LocalisationCache: try harder to use LCStoreCDB

When the LocalisationCache class is set to 'detect', we prefer LCStoreCDB if
$wgCacheDirectory is set, but we default to LCStoreDB otherwise. Rather than
give up, we should try wfTempDir(), since any directory that meets its criteria
is also suitable for LCStoreCDB.

Change-Id: Id3e2d2b18ddb423647bf2e893bcf942722c0e097

6 years agoImprove mismatched atomic section errors
Aaron Schulz [Fri, 6 Nov 2015 00:23:21 +0000 (16:23 -0800)]
Improve mismatched atomic section errors

Change-Id: I9b1561b6426ac00f72867452bee396b649ad8bfd

6 years agoMerge "Title: Add warning if newFromText is given non-string/non-null value"
jenkins-bot [Thu, 5 Nov 2015 22:08:35 +0000 (22:08 +0000)]
Merge "Title: Add warning if newFromText is given non-string/non-null value"

6 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Thu, 5 Nov 2015 20:24:32 +0000 (21:24 +0100)]
Localisation updates from https://translatewiki.net.

Change-Id: I14a339b32cc0ce21e1d8ed571a64f01fdcfb726e

6 years agoTitle: Add warning if newFromText is given non-string/non-null value
Timo Tijhof [Wed, 4 Nov 2015 01:20:36 +0000 (01:20 +0000)]
Title: Add warning if newFromText is given non-string/non-null value

Specify null as allowed value to make this method more easy to use.
The method is often used like that already and this makes it official.
Previously we were on a months-long trajectory to try and remove all
instances of passing null, but it was a never-ending quest (with new
ones introduced all the time). And in all cases the added handling
in the caller is the same as the handling for when this method
returns null. Requiring the caller to bounce null makes code more
complex, duplicates logic and serves no reason. Let this method be
a non-throwing validation method that returns null if given null.

Bug: T76305
Change-Id: I47517021471ac6fd6daca6deee039c8047224a33

6 years agoMerge "mw.ForeignStructuredUpload: Link author's username to their user page"
jenkins-bot [Thu, 5 Nov 2015 19:04:59 +0000 (19:04 +0000)]
Merge "mw.ForeignStructuredUpload: Link author's username to their user page"

6 years agoMerge "mw.ForeignStructuredUpload: Prevent categories and descriptions from being...
jenkins-bot [Thu, 5 Nov 2015 19:00:47 +0000 (19:00 +0000)]
Merge "mw.ForeignStructuredUpload: Prevent categories and descriptions from being duplicated"

6 years agoMerge "Fix name of PoolCounter callback in thumb.php"
jenkins-bot [Thu, 5 Nov 2015 18:57:48 +0000 (18:57 +0000)]
Merge "Fix name of PoolCounter callback in thumb.php"

6 years agoMerge "Make DeferredUpdates exception handling more robust"
jenkins-bot [Thu, 5 Nov 2015 18:53:44 +0000 (18:53 +0000)]
Merge "Make DeferredUpdates exception handling more robust"

6 years agoMerge "Convert recordUpload2() to using startAtomic/endAtomic"
jenkins-bot [Thu, 5 Nov 2015 18:50:59 +0000 (18:50 +0000)]
Merge "Convert recordUpload2() to using startAtomic/endAtomic"

6 years agomw.ForeignStructuredUpload: Link author's username to their user page
Bartosz Dziewoński [Thu, 5 Nov 2015 18:32:08 +0000 (19:32 +0100)]
mw.ForeignStructuredUpload: Link author's username to their user page

Bug: T117882
Change-Id: I3fa59264686fb67022b7e21a570761498baed690

6 years agomw.ForeignStructuredUpload: Prevent categories and descriptions from being duplicated
Bartosz Dziewoński [Thu, 5 Nov 2015 18:26:55 +0000 (19:26 +0100)]
mw.ForeignStructuredUpload: Prevent categories and descriptions from being duplicated

One copy would be added every time the user tried to save the file.
If they got an error and corrected it before trying again, there would
be two or more copies.

Bug: T116394
Change-Id: Ib4642d48e21d679ed675614efb29c77fa0e2c9c4

6 years agoConvert recordUpload2() to using startAtomic/endAtomic
Aaron Schulz [Sun, 1 Nov 2015 22:29:05 +0000 (14:29 -0800)]
Convert recordUpload2() to using startAtomic/endAtomic

* This avoids breaking transactions due to nesting
* Also improve readability a bit in this area

Change-Id: I81c41e83d14aa59930bfb99522ebcc25d8aa14f9

6 years agomw.ForeignStructuredUpload: Add some headers to file description page
Bartosz Dziewoński [Thu, 5 Nov 2015 18:17:20 +0000 (19:17 +0100)]
mw.ForeignStructuredUpload: Add some headers to file description page

Bug: T117878
Change-Id: I4b13134096cbb15d5bbab8d4688724e19ec94deb

6 years agoMerge "Use interwiki cache directly to resolve transwiki import sources"
jenkins-bot [Thu, 5 Nov 2015 16:52:31 +0000 (16:52 +0000)]
Merge "Use interwiki cache directly to resolve transwiki import sources"

6 years agoMerge "mediawiki.jqueryMsg: Don't duplicate link contents if parse() is called multip...
jenkins-bot [Thu, 5 Nov 2015 16:25:45 +0000 (16:25 +0000)]
Merge "mediawiki.jqueryMsg: Don't duplicate link contents if parse() is called multiple times"

6 years agomediawiki.jqueryMsg: Don't duplicate link contents if parse() is called multiple...
Bartosz Dziewoński [Wed, 4 Nov 2015 23:43:18 +0000 (00:43 +0100)]
mediawiki.jqueryMsg: Don't duplicate link contents if parse() is called multiple times

    mw.messages.set( 'foo', '[$1 Link]' );
    var msg = mw.message( 'foo', $( '<a>' ).attr( 'href', 'http://example.com/' ) );
    msg.parse(); msg.parse(); msg.parse();
    $( 'body ').append( msg.parse() ); // The link now says "LinkLinkLinkLink"

Change-Id: Id170b328164527320326178f24f56c5077cd50ab

6 years agoMerge "Don't link to title on "htmlform-title-not-exists""
jenkins-bot [Thu, 5 Nov 2015 13:48:30 +0000 (13:48 +0000)]
Merge "Don't link to title on "htmlform-title-not-exists""

6 years agoMerge "Add example of help for all query submodules"
jenkins-bot [Thu, 5 Nov 2015 13:43:26 +0000 (13:43 +0000)]
Merge "Add example of help for all query submodules"

6 years agoFix name of PoolCounter callback in thumb.php
Brian Wolff [Thu, 5 Nov 2015 06:59:58 +0000 (23:59 -0700)]
Fix name of PoolCounter callback in thumb.php

The callback is named doCachedWork, not getCachedWork. The typo
made it so that if multiple people try to render a file at once,
MediaWiki would not check if the last person to go already did the
needed work.

This might not make as much difference as it would sound, as the
pool counter lock is for the entire file, not a specific size,
and I'm unsure if swift has an equivalent of "slave lag", where the
check to see if a cached version is available might happen before
the write is totally visible.

Also merge the fallback handler into the error handler, so we get
actually error messages reported.

Change-Id: I12d228961de39cffc3d492554d93e30bd741adc9

6 years agoAdd example of help for all query submodules
S Page [Thu, 5 Nov 2015 02:38:28 +0000 (18:38 -0800)]
Add example of help for all query submodules

It's useful and shows difference from recursivesubmodules.

Change-Id: I85cb5c89fde0063bbd9dfc86d00c14553035f053

6 years agoRemoved raw HTML from tags-create-explanation message in SpecialTags.php
This, that and the other [Wed, 4 Nov 2015 23:47:23 +0000 (10:47 +1100)]
Removed raw HTML from tags-create-explanation message in SpecialTags.php

Bug: T111754
Change-Id: I0d1e84fae279845d1fa4f273e7c718010230eb36

6 years agoUse interwiki cache directly to resolve transwiki import sources
This, that and the other [Wed, 4 Nov 2015 23:42:14 +0000 (10:42 +1100)]
Use interwiki cache directly to resolve transwiki import sources

In order to resolve T17583, we will need to have a WMF-wide map of import
sources. This will most likely consist of a project dropdown, e.g.
"wikipedia", "wiktionary", "meta"... and a subproject dropdown, listing
each language edition of the selected project.

This would mean, if we wanted to import a page from French Wikipedia to
English Wikipedia, we would need to select project "wikipedia" and language
"fr". Currently, this causes the error "Bad interwiki link", because the
prefix "wikipedia:" maps to the local project namespace on enwiki, instead
of the relevant interwiki prefix.

To avoid this error we need to bypass Title and directly query the
interwiki map.

Change-Id: I68989203e367e7ea515e4ae2222c330b264a7cb1

6 years agoMerge "Allow passing detailed permission errors data to API"
jenkins-bot [Wed, 4 Nov 2015 22:38:47 +0000 (22:38 +0000)]
Merge "Allow passing detailed permission errors data to API"

6 years agoFindOrphanedFiles cleanups
Aaron Schulz [Wed, 4 Nov 2015 22:04:56 +0000 (14:04 -0800)]
FindOrphanedFiles cleanups

* Avoid empty DB list errors for some batches
* Use more convenient cannonical URLs

Change-Id: I37f59e0747525603828897196eabd6c64740aa02

6 years agoMerge "ApiQueryInfo.php: Add code and direction of the page content language"
jenkins-bot [Wed, 4 Nov 2015 21:02:30 +0000 (21:02 +0000)]
Merge "ApiQueryInfo.php: Add code and direction of the page content language"

6 years agoAPI: Forwards-compatibility for ApiTokens
Brad Jorsch [Wed, 4 Nov 2015 20:31:19 +0000 (15:31 -0500)]
API: Forwards-compatibility for ApiTokens

To make it easier for stuff to transition, allow action=tokens to return
the new types that action=query&meta=tokens supports.

Change-Id: I83887e555d54978b392933b4a3f6dada7ed00793

6 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Wed, 4 Nov 2015 20:03:34 +0000 (21:03 +0100)]
Localisation updates from https://translatewiki.net.

Change-Id: Ie228d496a844a954129782cac466cf691be4f3df

6 years agoMonologSpi: add support for customizing Monolog\Logger instances
Bryan Davis [Sun, 25 Oct 2015 21:39:44 +0000 (15:39 -0600)]
MonologSpi: add support for customizing Monolog\Logger instances

Proposed upstream changes to Monolog\Logger will require an ability to
call setter methods on newly created Logger instances to tune them for
use in high volume logging situations. Adding support for making these
types of adjustments to MediaWiki's Monolog integration will benefit
users of the updated library when they land upstream.

Arbitrary setters are called by adding a 'calls' array to the logger
specification. This array uses method names as keys and method arguments
as values. This syntax mirrors the setter invocation behavior of
ObjectFactory with the notable omission of Closure expansion in the
argument list before calling the Logger's setter method.

Bug: T116550
Change-Id: I990c7f00f57451f14954542f5404491b2660a0b7

6 years agoApiQueryInfo.php: Add code and direction of the page content language
Fomafix [Wed, 4 Nov 2015 16:50:48 +0000 (16:50 +0000)]
ApiQueryInfo.php: Add code and direction of the page content language

This change introduces two new keys in the response:
* "pagelanguagehtmlcode" for the BCP 47 conform language code
* "pagelanguagedir" for the direction of the language

Example:
 "pagelanguagehtmlcode": "en-GB"
 "pagelanguagedir": "ltr"

The existing key "pagelanguage" contains the internal language code format:
 "pagelanguage": "en-gb"

This duplication avoids reimplementing wfBCP47() and a mapping from
all language codes to the direction of the languages in JavaScript.

Bug: T117392
Change-Id: I26d033e33bfa60c8ff72ba70bb564cba4303a8b6

6 years agoMerge "HTMLFormField: Do not double-escape label in OOUI mode"
jenkins-bot [Wed, 4 Nov 2015 14:14:42 +0000 (14:14 +0000)]
Merge "HTMLFormField: Do not double-escape label in OOUI mode"

6 years agoRemove deprecated SiteObject and SiteArray classes
aude [Wed, 4 Nov 2015 12:16:10 +0000 (13:16 +0100)]
Remove deprecated SiteObject and SiteArray classes

SiteObject and SiteArray were deprecated in 1.21 and
can't find any use of them anywhere else in gerrit.

Change-Id: Iff3ba8a60ac9566998cce828c4034066fdefe804

6 years agoMerge "hooks.txt: don't use deprecated hooks in examples"
jenkins-bot [Wed, 4 Nov 2015 02:40:24 +0000 (02:40 +0000)]
Merge "hooks.txt: don't use deprecated hooks in examples"

6 years agoMerge "Remove WikiPage::doQuickEdit"
jenkins-bot [Wed, 4 Nov 2015 02:27:33 +0000 (02:27 +0000)]
Merge "Remove WikiPage::doQuickEdit"

6 years agohooks.txt: don't use deprecated hooks in examples
Ori Livneh [Wed, 4 Nov 2015 02:19:10 +0000 (18:19 -0800)]
hooks.txt: don't use deprecated hooks in examples

Change-Id: I01228e066de46f91d452767516ae0a11a9915bef

6 years agoRemove WikiPage::doQuickEdit
Aaron Schulz [Wed, 4 Nov 2015 02:13:45 +0000 (18:13 -0800)]
Remove WikiPage::doQuickEdit

Change-Id: If56f790b8a29b2262cba0feff7a96312c69cdb0c

6 years agoConvert ChangesList from MapCacheLRU to HashBagOStuff
Timo Tijhof [Tue, 3 Nov 2015 06:39:09 +0000 (06:39 +0000)]
Convert ChangesList from MapCacheLRU to HashBagOStuff

Also make use of getWithSetCallback() while at it.

Change-Id: I6bd29db7c6564fcaf4489ec0f226ac83bafc75e8

6 years agoobjectcache: Make HashBagOStuff LRU instead of least-recently-set
Aaron Schulz [Tue, 3 Nov 2015 10:06:40 +0000 (02:06 -0800)]
objectcache: Make HashBagOStuff LRU instead of least-recently-set

Refresh key in get() in addition to just set().

Change-Id: I7985b98b6a346eaed8bf0a7349b95fabea8e8614

6 years agoMerge "resourceloader: Use WAN cache for validateScriptFile cache"
jenkins-bot [Wed, 4 Nov 2015 01:19:57 +0000 (01:19 +0000)]
Merge "resourceloader: Use WAN cache for validateScriptFile cache"

6 years agoresourceloader: Use WAN cache for validateScriptFile cache
Aaron Schulz [Tue, 3 Nov 2015 13:12:28 +0000 (05:12 -0800)]
resourceloader: Use WAN cache for validateScriptFile cache

This keeps core callers more consistent.

Change-Id: I5e06a963a5e10204445a01c00109b46a6971bcfe

6 years agoAdd updateRevisionOn() sanity check for existing pages too
Aaron Schulz [Wed, 4 Nov 2015 00:44:52 +0000 (16:44 -0800)]
Add updateRevisionOn() sanity check for existing pages too

Change-Id: I4f2fc07b0365183efb431a828d40c557b691b18c

6 years agoHTMLFormField: Do not double-escape label in OOUI mode
Bartosz Dziewoński [Wed, 4 Nov 2015 00:15:29 +0000 (01:15 +0100)]
HTMLFormField: Do not double-escape label in OOUI mode

$this->getLabel() returns already parsed HTML. Who'd have thought?
https://www.wikidata.org/wiki/Wikidata:Contact_the_development_team#Display_issue_on_Special:NewItem

Change-Id: I52aa9b78fde27d4a16b3636fa6b70d3c69ff2346

6 years agoMerge "Add Timing interface"
jenkins-bot [Tue, 3 Nov 2015 23:36:57 +0000 (23:36 +0000)]
Merge "Add Timing interface"

6 years agoMerge "Avoid use of rollback() in WikiPage::doEditContent()"
jenkins-bot [Tue, 3 Nov 2015 23:36:53 +0000 (23:36 +0000)]
Merge "Avoid use of rollback() in WikiPage::doEditContent()"

6 years agoAvoid use of rollback() in WikiPage::doEditContent()
Aaron Schulz [Wed, 7 Oct 2015 20:01:20 +0000 (13:01 -0700)]
Avoid use of rollback() in WikiPage::doEditContent()

* Use the CAS style page row checks instead
* This a first step towards switching to startAtomic/endAtomic
* Only a sanity check uses rollback() now, which should never
  be hit unless there is a serious DB layer bug

Change-Id: Ideb189f918dee5d3e3c7b91cb92179df514ef35a

6 years agoAdd Timing interface
Ori Livneh [Tue, 3 Nov 2015 02:26:07 +0000 (18:26 -0800)]
Add Timing interface

* Add `Timing`, an interface which mimics the W3C User Timing API.
  It provides a canonical way to store and retrieve markers (timestamps)
  and measures (timestamps + duration).
* As the initial use-case, use it to record 'requestShutdown'.

Change-Id: I36b29162ffcc091406df025463b0e2797e52f19a

6 years agomw.widgets.ComplexTitleInputWidget: Add infusion helpers
Bartosz Dziewoński [Thu, 1 Oct 2015 23:30:52 +0000 (01:30 +0200)]
mw.widgets.ComplexTitleInputWidget: Add infusion helpers

* reusePreInfuseDOM
* gatherPreInfuseState
* restorePreInfuseState

Depends on I3c21b3710d16dbb4dbcbdd3871a70fdfd0e7b536 in OOjs UI.

Bug: T114134
Bug: T117310
Change-Id: I939551579fe1d03603d65b3562c1c977681994a6

6 years agoMerge "phpcs: Fix some "Single space expected before elseif""
jenkins-bot [Tue, 3 Nov 2015 22:10:54 +0000 (22:10 +0000)]
Merge "phpcs: Fix some "Single space expected before elseif""

6 years agoUpdate OOjs UI to v0.13.1
James D. Forrester [Tue, 3 Nov 2015 21:44:50 +0000 (13:44 -0800)]
Update OOjs UI to v0.13.1

Release notes:
 https://git.wikimedia.org/blob/oojs%2Fui.git/v0.13.1/History.md

Change-Id: Ic8fbb6ee4326c73243ea655708b9cfd09bc7e52a

6 years agoMake DeferredUpdates exception handling more robust
Aaron Schulz [Tue, 3 Nov 2015 20:47:05 +0000 (12:47 -0800)]
Make DeferredUpdates exception handling more robust

Change-Id: Ica2b8dce0978818a2f51684b97c93a3ba845d81a

6 years agoMerge "Add comment to unused EDIT_DEFER_UPDATES in Defines.php"
jenkins-bot [Tue, 3 Nov 2015 20:59:33 +0000 (20:59 +0000)]
Merge "Add comment to unused EDIT_DEFER_UPDATES in Defines.php"

6 years agoMerge "Localisation updates from https://translatewiki.net."
Translation updater bot [Tue, 3 Nov 2015 20:29:17 +0000 (20:29 +0000)]
Merge "Localisation updates from https://translatewiki.net."

6 years agoMerge "Add WebResponse::clearCookie()"
jenkins-bot [Tue, 3 Nov 2015 20:25:42 +0000 (20:25 +0000)]
Merge "Add WebResponse::clearCookie()"

6 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Tue, 3 Nov 2015 20:24:41 +0000 (21:24 +0100)]
Localisation updates from https://translatewiki.net.

Change-Id: Ifcaf9a55495655536dea379abeab91c265d47e36

6 years agoAdd WebResponse::clearCookie()
Gergő Tisza [Tue, 3 Nov 2015 08:45:41 +0000 (00:45 -0800)]
Add WebResponse::clearCookie()

Easier-to-read alias for setCookie(..., '', time() - 86400).

Change-Id: I0357c4a38085c4754bf6ff7e40756179d19b912d

6 years agoMerge "API: Log all deprecated parameter uses to api-feature-usage.log"
jenkins-bot [Tue, 3 Nov 2015 18:20:43 +0000 (18:20 +0000)]
Merge "API: Log all deprecated parameter uses to api-feature-usage.log"

6 years agoMerge "Change Special:ChangePassword to use OOUI"
jenkins-bot [Tue, 3 Nov 2015 18:03:32 +0000 (18:03 +0000)]
Merge "Change Special:ChangePassword to use OOUI"

6 years agoAPI: Log all deprecated parameter uses to api-feature-usage.log
Brad Jorsch [Tue, 3 Nov 2015 17:18:29 +0000 (12:18 -0500)]
API: Log all deprecated parameter uses to api-feature-usage.log

Some were being logged, and some weren't. Let's log them all
automatically when PARAM_DEPRECATED is processed, instead of requiring
each module to manually log them.

Bug: T117569
Change-Id: Ia38aeeccd0b9857b12b28914f509284483fbcca8

6 years agoMerge "Avoid "$text must be a string" in Linker::formatLinksInComment"
jenkins-bot [Tue, 3 Nov 2015 15:33:17 +0000 (15:33 +0000)]
Merge "Avoid "$text must be a string" in Linker::formatLinksInComment"

6 years agoChange Special:ChangePassword to use OOUI
Florian [Tue, 15 Sep 2015 17:54:02 +0000 (19:54 +0200)]
Change Special:ChangePassword to use OOUI

In order to work with OOUI properly, SpecialChangePassword::attemptReset() doesn't
throw PasswordErrors anymore. It now returns a Status object which
is set to fatal, if some requirement doesn't meet.

In OOUIHTMLForm: Handle Message objects as errors correctly. It's a valid parameter
for fatal to use a Message object instead of a message key, so OOUIHTMLForm needs
to handle Mesage objects as Message objects (can be parsed directly) instead of using
it as a message key (which usually doesn't exist).

Bug: T78373
Change-Id: Id768833bbd966cdeadd5a13fdb64b636ea2062ef

6 years agoMerge "Move brace matching rules to Preprocessor class"
jenkins-bot [Tue, 3 Nov 2015 11:24:03 +0000 (11:24 +0000)]
Merge "Move brace matching rules to Preprocessor class"

6 years agoMerge "Improve BacklinkCache field docs"
jenkins-bot [Tue, 3 Nov 2015 11:10:45 +0000 (11:10 +0000)]
Merge "Improve BacklinkCache field docs"

6 years agoMerge "Improve MIME detection in FileBackend"
jenkins-bot [Tue, 3 Nov 2015 11:10:41 +0000 (11:10 +0000)]
Merge "Improve MIME detection in FileBackend"

6 years agoMerge "Avoid "headers already sent" error in jobs for UseDC cookie"
jenkins-bot [Tue, 3 Nov 2015 10:58:07 +0000 (10:58 +0000)]
Merge "Avoid "headers already sent" error in jobs for UseDC cookie"

6 years agoImprove BacklinkCache field docs
Aaron Schulz [Tue, 3 Nov 2015 10:56:30 +0000 (02:56 -0800)]
Improve BacklinkCache field docs

Change-Id: I8303d5577ac84b8882e5ad79ac3058d6bf49356f

6 years agoMerge "Add script to find orphaned LocalRepo files"
jenkins-bot [Tue, 3 Nov 2015 10:48:31 +0000 (10:48 +0000)]
Merge "Add script to find orphaned LocalRepo files"

6 years agoMerge "resourceloader: Sanitize lang with isValidBuiltInCode(), not isValidCode()"
jenkins-bot [Tue, 3 Nov 2015 10:42:16 +0000 (10:42 +0000)]
Merge "resourceloader: Sanitize lang with isValidBuiltInCode(), not isValidCode()"

6 years agoMerge "objectcache: Add a clear() method to HashBagOStuff"
Aaron Schulz [Tue, 3 Nov 2015 10:16:19 +0000 (10:16 +0000)]
Merge "objectcache: Add a clear() method to HashBagOStuff"

6 years agoMerge "objectcache: Refresh key in HashBagOStuff::set() for maxKeys eviction"
jenkins-bot [Tue, 3 Nov 2015 10:13:08 +0000 (10:13 +0000)]
Merge "objectcache: Refresh key in HashBagOStuff::set() for maxKeys eviction"

6 years agoobjectcache: Add a clear() method to HashBagOStuff
Timo Tijhof [Tue, 3 Nov 2015 06:49:13 +0000 (06:49 +0000)]
objectcache: Add a clear() method to HashBagOStuff

Including tests for delete() and clear().

Change-Id: If39d729838e312523f0df3ae8b235ebe939a17fd

6 years agoobjectcache: Refresh key in HashBagOStuff::set() for maxKeys eviction
Timo Tijhof [Tue, 3 Nov 2015 05:59:07 +0000 (05:59 +0000)]
objectcache: Refresh key in HashBagOStuff::set() for maxKeys eviction

* Match behaviour of MapCacheLRU and ProcessCacheLRU.
* Add missing unit tests for TTL and maxCacheKeys eviction behaviour.

Change-Id: I559eae1cd336274b21728e86775cfbad7e2f2c6d

6 years agoMerge "objectcache: Move unit tests for HashBagOStuff to its own suite"
jenkins-bot [Tue, 3 Nov 2015 09:22:27 +0000 (09:22 +0000)]
Merge "objectcache: Move unit tests for HashBagOStuff to its own suite"

6 years agoMerge "objectcache: Add TTL_INDEFINITE to IExpiringStore"
jenkins-bot [Tue, 3 Nov 2015 09:22:23 +0000 (09:22 +0000)]
Merge "objectcache: Add TTL_INDEFINITE to IExpiringStore"

6 years agoMerge "LinkCache: Remove deprecated getBadLinks and getGoodLinks methods"
jenkins-bot [Tue, 3 Nov 2015 09:12:00 +0000 (09:12 +0000)]
Merge "LinkCache: Remove deprecated getBadLinks and getGoodLinks methods"

6 years agoMerge "OutputPage: documentation for (semi-)deprecated methods"
jenkins-bot [Tue, 3 Nov 2015 07:04:14 +0000 (07:04 +0000)]
Merge "OutputPage: documentation for (semi-)deprecated methods"

6 years agoobjectcache: Add TTL_INDEFINITE to IExpiringStore
Timo Tijhof [Tue, 3 Nov 2015 06:36:06 +0000 (06:36 +0000)]
objectcache: Add TTL_INDEFINITE to IExpiringStore

Especially useful when interacting with getWithSetCallback of
HashBagOStuff where a $exptime is required before the callback.

In set() it is typically left out and thus not as counter-intuitive.

Change-Id: Ic2f7adda3c00cefe701d77bea91a7e8e77ef1439

6 years agoLinkCache: Remove deprecated getBadLinks and getGoodLinks methods
Timo Tijhof [Tue, 3 Nov 2015 06:05:22 +0000 (06:05 +0000)]
LinkCache: Remove deprecated getBadLinks and getGoodLinks methods

Deprecated since MediaWiki 1.26 (32d1017e7d). These methods contain the
only remaining callers of MapCacheLRU::getAllKeys() which is the only odd
method of MapCacheLRU not supported by BagOStuff.

Change-Id: I64e054803595d49a5bd779accc94353924f7d87d

6 years agoobjectcache: Move unit tests for HashBagOStuff to its own suite
Timo Tijhof [Tue, 3 Nov 2015 05:28:18 +0000 (05:28 +0000)]
objectcache: Move unit tests for HashBagOStuff to its own suite

Follows-up 7cddc22.

Also use PHPUnit_Framework_TestCase as parent instead of MediaWikiTestCase
in preparation for library extraction.

Change-Id: I0e68e56ecf8376b52a59c33ba6dd18b671bdcfc9

6 years agoMerge "Make SqlBagOStuff respect WRITE_SYNC flag"
jenkins-bot [Tue, 3 Nov 2015 05:27:38 +0000 (05:27 +0000)]
Merge "Make SqlBagOStuff respect WRITE_SYNC flag"

6 years agoAvoid "headers already sent" error in jobs for UseDC cookie
Aaron Schulz [Mon, 2 Nov 2015 23:52:37 +0000 (15:52 -0800)]
Avoid "headers already sent" error in jobs for UseDC cookie

Bug: T115413
Change-Id: Ic6050bef04adbda2557422bf60b2ebe300c89629

6 years agoMake SqlBagOStuff respect WRITE_SYNC flag
Aaron Schulz [Sat, 31 Oct 2015 10:35:44 +0000 (03:35 -0700)]
Make SqlBagOStuff respect WRITE_SYNC flag

Also remove some pointless newlines in class.

Change-Id: I75880c56b1eac63c9a0616ca10890904ce823a99

6 years agoMove brace matching rules to Preprocessor class
Ori Livneh [Sat, 31 Oct 2015 23:10:54 +0000 (16:10 -0700)]
Move brace matching rules to Preprocessor class

Instead of declaring the array of rules within both Preprocessor_DOM:: and
Preprocessor_Hash::preprocessToXml(), declare it as a protected property of the
parent Preprocessor class.

Change-Id: I6193de66566c164fe85cdd6a88c04fa9c565f1a9

6 years agoMerge "TOC: Separate columns for tocnumber and toctext"
jenkins-bot [Tue, 3 Nov 2015 01:40:43 +0000 (01:40 +0000)]
Merge "TOC: Separate columns for tocnumber and toctext"

6 years agoTOC: Separate columns for tocnumber and toctext
Fomafix [Fri, 13 Mar 2015 07:49:24 +0000 (07:49 +0000)]
TOC: Separate columns for tocnumber and toctext

IE 7 and lower ignores these definitions and shows the TOC as before.

Bug: T92481
Change-Id: Ibed5f02f04e63a4152109ddf9c2a23f4e45880ca

6 years agogallery.js: Do not resize gallery caption
Fomafix [Mon, 2 Nov 2015 05:50:57 +0000 (05:50 +0000)]
gallery.js: Do not resize gallery caption

Resize only gallerybox which contains resized images.

Bug: T91075
Change-Id: Idcaf22fbaabaa26c8d06f5dd0194d4ed7c7b1a60

6 years agoLet Import also read CDATA as content
Matthias Mullie [Wed, 14 Oct 2015 09:14:51 +0000 (11:14 +0200)]
Let Import also read CDATA as content

Change-Id: I55275e20bb2fd589247fca5c44fd54d1ae9ff686

6 years agoMerge "Convert JobQueueDB to using the WAN cache"
jenkins-bot [Tue, 3 Nov 2015 00:29:35 +0000 (00:29 +0000)]
Merge "Convert JobQueueDB to using the WAN cache"

6 years agoMerge "mw.widgets.TitleWidget: Correct documentation"
jenkins-bot [Tue, 3 Nov 2015 00:12:48 +0000 (00:12 +0000)]
Merge "mw.widgets.TitleWidget: Correct documentation"

6 years agoMerge "User: Migrate from foreign cache to global cache for UserRightsProxy"
jenkins-bot [Mon, 2 Nov 2015 23:51:52 +0000 (23:51 +0000)]
Merge "User: Migrate from foreign cache to global cache for UserRightsProxy"

6 years agoMerge "Convert SiteStatsUpdate to using getMainStashInstance()"
jenkins-bot [Mon, 2 Nov 2015 22:47:10 +0000 (22:47 +0000)]
Merge "Convert SiteStatsUpdate to using getMainStashInstance()"

6 years agomw.widgets.TitleWidget: Correct documentation
Bartosz Dziewoński [Mon, 2 Nov 2015 22:35:44 +0000 (23:35 +0100)]
mw.widgets.TitleWidget: Correct documentation

Change-Id: If1ea6d411b57b4cb6e60f400a86351dc3dc7acbc

6 years agoRemove getLocalServerInstance try/catch in UIDGenerator and DBLockManager
Timo Tijhof [Mon, 2 Nov 2015 21:45:43 +0000 (21:45 +0000)]
Remove getLocalServerInstance try/catch in UIDGenerator and DBLockManager

Follows-up 17c91ad610 in which the exception was removed.

Change-Id: If0c8465d0e04f69f29f3f2602dac7ae4538f7542

6 years agoMerge "Replace newAccelerator() with getLocalServerInstance()"
jenkins-bot [Mon, 2 Nov 2015 22:04:21 +0000 (22:04 +0000)]
Merge "Replace newAccelerator() with getLocalServerInstance()"

6 years agoUser: Migrate from foreign cache to global cache for UserRightsProxy
Timo Tijhof [Tue, 27 Oct 2015 23:43:40 +0000 (23:43 +0000)]
User: Migrate from foreign cache to global cache for UserRightsProxy

Avoid having one wiki access another wiki's local keyspace.
Instead, use the global keyspace to share values across wikis.

Also, imitating wfMemcKey from wfForeignMemcKey was semantically
incorrect due to $wgCachePrefix having precedence. Most interfaces
(e.g. UserRightsProxy, FileRepo, JobQueue etc.) only have access
to the wiki id (dbname + prefix). The local cache configuration
for wgCachePrefix is not and shouldn't have to be exposed.

Start enforcing that local cache keys are left private and
to share keys, one must use global keys.

Global keys (prefixed with "global:") have their own space and we
can use the wiki-id as regular key segment for keys about users.

Also:
* Expose a method to keep formatting of this key in one place.
  As it used used in many different places in core, as well
  as in CentralAuth.
* Make use of wfWikiId() in getDefaultKeyspace() to avoid
  duplicating this logic.

Change-Id: I58836a24b9e239f460ab489bd2fe8ced8259833c

6 years agoReplace newAccelerator() with getLocalServerInstance()
Aaron Schulz [Sat, 31 Oct 2015 18:42:48 +0000 (11:42 -0700)]
Replace newAccelerator() with getLocalServerInstance()

The name is clearer and more consistent, with simpler arguments.

Change-Id: I7205a99ce033e8b086a52cd02c8a721e99c84b1e

6 years agoRevert "Add MediaWiki-Timestamp header to ResourceLoader requests"
Ori Livneh [Mon, 2 Nov 2015 21:36:07 +0000 (13:36 -0800)]
Revert "Add MediaWiki-Timestamp header to ResourceLoader requests"

I have not had the time and wherewithal to write the follow-up code that
actually uses this value. So just remove it for now.
This reverts commit 3d5aca4a406424bf69016f9c7c4a94b317b62d25.

Change-Id: Ice9b65f39802b55b3d4ddf801c06d1be3227fd5b

6 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Mon, 2 Nov 2015 21:19:27 +0000 (22:19 +0100)]
Localisation updates from https://translatewiki.net.

Change-Id: I57ee8f81dffb1b08e3dd37ada05711548fbeeb71

6 years agoMerge "Installer: Validate password against sysop/bureaucrat policies"
jenkins-bot [Mon, 2 Nov 2015 19:35:52 +0000 (19:35 +0000)]
Merge "Installer: Validate password against sysop/bureaucrat policies"

6 years agoAllow passing detailed permission errors data to API
Bartosz Dziewoński [Mon, 19 Oct 2015 12:30:40 +0000 (14:30 +0200)]
Allow passing detailed permission errors data to API

Using the new system introduced in
1c57794e371d74e1d88748de567a1c3358c3ad2e (see T47843).

This change allows Title::getUserPermissionsErrors() to include
MessageSpecifiers instead of string message keys in its return value.
This doesn't seem to have any bad effects, and should work seamlessly as
long as callers aren't trying to do anything stupid and just pass the
value to PermissionsError or OutputPage::showPermissionsErrorPage()
or wfMessage() or some such.

If the callers *are* trying something stupid, nothing worse than
duplicated or otherwise less-than-perfect error messages (in code
which tries to handle some message keys specially) should happen.
(I fixed wfMergeErrorArrays(), but who knows what else lurks in all
this code.) Any problems should only affect new-style errors using
MessageSpecifier, though.

Since MessageSpecifiers tend to be stringable, we probably won't get
fatals, but might get incorrect checks. Should we try to log this
happening somehow?

Goes with I42a0c5b0ea7e61088dd609b764dd7d1396c60cd5 in TitleBlacklist.

Bug: T115258
Change-Id: I1334ba21a2862973a9d8ff5be2c9bec06a82698b