lhc/web/wiklou.git
8 years agoInstaller: Validate password against sysop/bureaucrat policies
This, that and the other [Thu, 29 Oct 2015 12:24:40 +0000 (23:24 +1100)]
Installer: Validate password against sysop/bureaucrat policies

Previously, user-group-specific policies were not checked, because the
user hadn't been created yet, and so wasn't assigned to any groups. In his
overhaul of password policy, Chris wrote a function that was designed for
exactly this purpose (UserPasswordPolicy::checkUserPasswordForGroups) but
didn't put it into use.

Some changes to the error handling code are needed so the error messages
display correctly.

Bug: T115700
Change-Id: I1391c77c9667b646b29003bb0b2abcdc21d8c4d8

8 years agoAdd tests for MemcachedBagOStuff::validateKeyEncoding
Thiemo Mättig [Wed, 28 Oct 2015 15:26:37 +0000 (16:26 +0100)]
Add tests for MemcachedBagOStuff::validateKeyEncoding

If3e20c6 and the following patches introduced a breaking change and
cause a regression in Wikibase because we are using the version number
constant as part of a cache key prefix. Currently the Wikibase version
is set to "0.5 alpha".

Space characters were allowed before and encoded as "%20". This does
not happen any more.

Change-Id: Ia2fd4ed6738a10e02050bced947ef5d4e8b98980

8 years agoMerge "resourceloader: Consistently refer to the framework as ResourceLoader"
jenkins-bot [Wed, 28 Oct 2015 14:53:58 +0000 (14:53 +0000)]
Merge "resourceloader: Consistently refer to the framework as ResourceLoader"

8 years agoMerge "resourceloader: Remove 'loaderScripts' option from FileModule"
jenkins-bot [Wed, 28 Oct 2015 14:53:37 +0000 (14:53 +0000)]
Merge "resourceloader: Remove 'loaderScripts' option from FileModule"

8 years agoMerge "Add help link to Special:Search"
jenkins-bot [Wed, 28 Oct 2015 11:58:26 +0000 (11:58 +0000)]
Merge "Add help link to Special:Search"

8 years agoMerge "Convert DjVU cache to WANObjectCache"
jenkins-bot [Wed, 28 Oct 2015 05:30:14 +0000 (05:30 +0000)]
Merge "Convert DjVU cache to WANObjectCache"

8 years agoMerge "Improve WAN cache delete() docs a bit"
jenkins-bot [Wed, 28 Oct 2015 05:26:04 +0000 (05:26 +0000)]
Merge "Improve WAN cache delete() docs a bit"

8 years agoMerge "Bump development Monolog version"
jenkins-bot [Wed, 28 Oct 2015 05:20:05 +0000 (05:20 +0000)]
Merge "Bump development Monolog version"

8 years agoImprove WAN cache delete() docs a bit
Aaron Schulz [Wed, 28 Oct 2015 04:52:30 +0000 (21:52 -0700)]
Improve WAN cache delete() docs a bit

Also use more TTL constants in getWithSetCallback() examples

Change-Id: I866f0464c07fa0c8977c6e908e92186b2ef9de43

8 years agoConvert DjVU cache to WANObjectCache
Aaron Schulz [Mon, 26 Oct 2015 17:43:21 +0000 (10:43 -0700)]
Convert DjVU cache to WANObjectCache

Also unified the total and per page dimensions cache

Change-Id: Ib6ad7c3cdfb4fe3a88d25240c3e362664a9b41fd

8 years agoConvert wfGenerateThumbnail() away from $wgMemc
Aaron Schulz [Wed, 28 Oct 2015 04:40:01 +0000 (21:40 -0700)]
Convert wfGenerateThumbnail() away from $wgMemc

Change-Id: I06c2d90cb3e75142f781afa80f917d4155513a22

8 years agoMerge "objectcache: Introduce IExpiringStore for convenient TTL constants"
jenkins-bot [Wed, 28 Oct 2015 04:31:33 +0000 (04:31 +0000)]
Merge "objectcache: Introduce IExpiringStore for convenient TTL constants"

8 years agoobjectcache: Introduce IExpiringStore for convenient TTL constants
Timo Tijhof [Mon, 19 Oct 2015 17:52:19 +0000 (18:52 +0100)]
objectcache: Introduce IExpiringStore for convenient TTL constants

Also consistently use self:: instead of BagOStuff:: for constants
referenced within the BagOStuff class.

Change-Id: I20fde9fa5cddcc9e92fa6a02b05dc7effa846742

8 years agoresourceloader: Consistently refer to the framework as ResourceLoader
Timo Tijhof [Wed, 28 Oct 2015 03:24:40 +0000 (03:24 +0000)]
resourceloader: Consistently refer to the framework as ResourceLoader

Change-Id: Ia59e4eac9662723e80d62f7cfcb9e4292e3ee4de

8 years agoresourceloader: Remove 'loaderScripts' option from FileModule
Timo Tijhof [Mon, 19 Oct 2015 23:04:23 +0000 (00:04 +0100)]
resourceloader: Remove 'loaderScripts' option from FileModule

Not used in any of our public repositories.

Bug: T65240
Change-Id: I1e9f741c3ef0f922129ecd10039228b58565bf62

8 years agoMerge "set serialize_precision to 17, current PHP default"
jenkins-bot [Wed, 28 Oct 2015 01:52:29 +0000 (01:52 +0000)]
Merge "set serialize_precision to 17, current PHP default"

8 years agoLinksUpdate: Keep track of the triggering User
Kunal Mehta [Tue, 27 Oct 2015 21:49:51 +0000 (14:49 -0700)]
LinksUpdate: Keep track of the triggering User

So extensions like Echo are able to attribute post-edit link updates to
specific the users who triggered them.

Bug: T116485
Change-Id: I083736a174b6bc15e3ce60b2b107c697d0ac13da

8 years agoBump development Monolog version
Bryan Davis [Tue, 27 Oct 2015 22:53:03 +0000 (16:53 -0600)]
Bump development Monolog version

Related mediawiki/vendor change: I6d6db4c

Bug: T116550
Change-Id: I71b2051c4c6193a435183ed00da52e9dc6c0673c

8 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Tue, 27 Oct 2015 20:12:35 +0000 (21:12 +0100)]
Localisation updates from https://translatewiki.net.

Change-Id: Ib468dabe3f7d642b58087711945f6026f6d143c8

8 years agoReplace local RunningStat with wikimedia/running-stat library
Ori Livneh [Tue, 27 Oct 2015 18:41:17 +0000 (11:41 -0700)]
Replace local RunningStat with wikimedia/running-stat library

* mediawiki/vendor change: I66b419c8168df.
* Add back-compat shim in includes/compat/RunningStatCompat.php.

Change-Id: Ibad4dc0ce5aa8697791865ed8ea61a25bae7b3e0

8 years agoMerge "Update OOjs UI to v0.13.0"
jenkins-bot [Tue, 27 Oct 2015 18:53:49 +0000 (18:53 +0000)]
Merge "Update OOjs UI to v0.13.0"

8 years agoRestore TitleMoveComplete by-reference flags to avoid errors
Aaron Schulz [Tue, 27 Oct 2015 18:08:17 +0000 (11:08 -0700)]
Restore TitleMoveComplete by-reference flags to avoid errors

They should be removed from extensions, but they don't
really hurt much for now.

Change-Id: I64b570e376062155afdf879c3ce85560127c6792

8 years agoUpdate OOjs UI to v0.13.0
James D. Forrester [Tue, 27 Oct 2015 17:58:23 +0000 (18:58 +0100)]
Update OOjs UI to v0.13.0

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

Change-Id: Ie4f66b15f4f5ec9932d5fd72e12b4453724e3742

8 years agoset serialize_precision to 17, current PHP default
saper [Tue, 27 Oct 2015 17:44:41 +0000 (18:44 +0100)]
set serialize_precision to 17, current PHP default

Follow up to:
https://gerrit.wikimedia.org/r/#/c/249018/

Bug: T116683
Change-Id: I6e8dfab473ae2c18e68c8e4360159c9cc0e09758

8 years agoMerge "Get rid of CSS transitions on form elements in mediawiki.ui"
jenkins-bot [Tue, 27 Oct 2015 17:24:19 +0000 (17:24 +0000)]
Merge "Get rid of CSS transitions on form elements in mediawiki.ui"

8 years agoMerge "Use ImportStringSource for simple import sources"
jenkins-bot [Tue, 27 Oct 2015 15:15:20 +0000 (15:15 +0000)]
Merge "Use ImportStringSource for simple import sources"

8 years agoMerge "Revert "Enforce stricter slave lag limits for bot API requests""
jenkins-bot [Tue, 27 Oct 2015 14:02:14 +0000 (14:02 +0000)]
Merge "Revert "Enforce stricter slave lag limits for bot API requests""

8 years agoRevert "Enforce stricter slave lag limits for bot API requests"
Adrian Lang [Tue, 27 Oct 2015 13:47:38 +0000 (13:47 +0000)]
Revert "Enforce stricter slave lag limits for bot API requests"

This broke most Wikidata API PHPUnit tests.

This reverts commit dc10216e77b06b0fc7bb5e0824eb0967129c2e1f.

Change-Id: I19285ff0eddffb38cdbf45bbd05ba2d8a1816b41

8 years agoMerge "Convert ForeignApiRepo::httpGetCached() to the WAN cache"
jenkins-bot [Tue, 27 Oct 2015 11:21:24 +0000 (11:21 +0000)]
Merge "Convert ForeignApiRepo::httpGetCached() to the WAN cache"

8 years agoMerge "Completely defer EditPage::updateWatchlist"
jenkins-bot [Tue, 27 Oct 2015 11:09:17 +0000 (11:09 +0000)]
Merge "Completely defer EditPage::updateWatchlist"

8 years agoMerge "Make Swift backend respect Content-Type in create/store"
jenkins-bot [Tue, 27 Oct 2015 10:40:11 +0000 (10:40 +0000)]
Merge "Make Swift backend respect Content-Type in create/store"

8 years agoMerge "filebackend: Remove some old Content-Disposition b/c code"
jenkins-bot [Tue, 27 Oct 2015 10:33:05 +0000 (10:33 +0000)]
Merge "filebackend: Remove some old Content-Disposition b/c code"

8 years agoMerge "Enforce stricter slave lag limits for bot API requests"
jenkins-bot [Tue, 27 Oct 2015 10:30:44 +0000 (10:30 +0000)]
Merge "Enforce stricter slave lag limits for bot API requests"

8 years agoMerge "Measure commitMasterChanges() run time"
jenkins-bot [Tue, 27 Oct 2015 10:18:56 +0000 (10:18 +0000)]
Merge "Measure commitMasterChanges() run time"

8 years agoMerge "Protect WAN cache sets() against uncommitted data"
jenkins-bot [Tue, 27 Oct 2015 10:18:52 +0000 (10:18 +0000)]
Merge "Protect WAN cache sets() against uncommitted data"

8 years agoMerge "Fixes related to WikiPage::triggerOpportunisticLinksUpdate()"
jenkins-bot [Tue, 27 Oct 2015 10:07:48 +0000 (10:07 +0000)]
Merge "Fixes related to WikiPage::triggerOpportunisticLinksUpdate()"

8 years agoMerge "Follow-up to Ie3499d"
jenkins-bot [Tue, 27 Oct 2015 09:47:21 +0000 (09:47 +0000)]
Merge "Follow-up to Ie3499d"

8 years agoMerge "resoureloader: Consolidate styles-only queue at the top"
jenkins-bot [Tue, 27 Oct 2015 09:22:44 +0000 (09:22 +0000)]
Merge "resoureloader: Consolidate styles-only queue at the top"

8 years agoFollow-up to Ie3499d
Ori Livneh [Tue, 27 Oct 2015 07:44:47 +0000 (00:44 -0700)]
Follow-up to Ie3499d

My first pass at what became Ie3499d9f2 was to keep the exception for duplicate
registrations with conflicting parameters but downgrade to a warning if the
registration attempts are identically parametrized. I then removed the
exception entirely, but left the if-block, which does not make much sense, as
it means we pass over silently module registrations that set different
parameters, and throw a warning only when they are the same.

Change-Id: I13da33faf2f058ac75ef4b1615c4fafc18f14505

8 years agoMerge "mediawiki.jqueryMsg: Lazy-initialize parsers with getFailableParserFn()"
jenkins-bot [Tue, 27 Oct 2015 05:19:37 +0000 (05:19 +0000)]
Merge "mediawiki.jqueryMsg: Lazy-initialize parsers with getFailableParserFn()"

8 years agoMerge "mediawiki.jqueryMsg: Remove 'astCache'"
jenkins-bot [Tue, 27 Oct 2015 04:57:01 +0000 (04:57 +0000)]
Merge "mediawiki.jqueryMsg: Remove 'astCache'"

8 years agomediawiki.jqueryMsg: Lazy-initialize parsers with getFailableParserFn()
Bartosz Dziewoński [Fri, 16 Oct 2015 20:17:41 +0000 (22:17 +0200)]
mediawiki.jqueryMsg: Lazy-initialize parsers with getFailableParserFn()

Because they rely on data set by setParserDefaults(), and that is only
called later (from ResourceLoaderJqueryMsgModule).

Bug: T115708
Change-Id: I085d27b1b00873bc5b22573ef7eb9d17b8e5e1fd

8 years agomediawiki.jqueryMsg: Remove 'astCache'
Bartosz Dziewoński [Fri, 16 Oct 2015 20:08:41 +0000 (22:08 +0200)]
mediawiki.jqueryMsg: Remove 'astCache'

All it does is cause problems.

Bug: T54042
Change-Id: I955ee61f6c0040203959ab8f45efb56a32431768

8 years agoregistration: Support custom classes in "ResourceModules" schema
Kunal Mehta [Sun, 2 Aug 2015 23:42:46 +0000 (16:42 -0700)]
registration: Support custom classes in "ResourceModules" schema

Instead of expecting everything to be a ResourceLoaderFileModule, use
the "anyOf" property to validate against multiple schemas. The following
schemas are now allowed:
* The ResourceLoaderFileModule schema, now with the "targets" property
* A schema for ResourceLoaderImageModule
* A generic schema that requires the "class" property is set, but not to
"ResourceLoaderFileModule" or "ResourceLoaderImageModule".

The last schema will allow for any custom ResourceLoaderModule class to
be set in extension.json with arbitrary parameters.

One downside of this is that the error messages shown when a file does
not validate get a little more confusing, as it shows the error messages
for each schema it does not match.

Bug: T105236
Change-Id: I5e4bfa69c733187c7b27294c159cac05b3b92e81

8 years agoMerge "Improve DBReadOnlyError/DBExpectedError page title"
jenkins-bot [Tue, 27 Oct 2015 04:39:02 +0000 (04:39 +0000)]
Merge "Improve DBReadOnlyError/DBExpectedError page title"

8 years agoCompletely defer EditPage::updateWatchlist
Aaron Schulz [Tue, 27 Oct 2015 04:10:54 +0000 (21:10 -0700)]
Completely defer EditPage::updateWatchlist

This should reduce their profile time shown on xenon

Change-Id: I8e92de22755b592cc7b2d3fab36cff2761ab2bb7

8 years agoMerge "Reset serialize_precision to stabilize tests"
jenkins-bot [Tue, 27 Oct 2015 04:07:31 +0000 (04:07 +0000)]
Merge "Reset serialize_precision to stabilize tests"

8 years agoresoureloader: Consolidate styles-only queue at the top
Timo Tijhof [Tue, 27 Oct 2015 03:39:34 +0000 (03:39 +0000)]
resoureloader: Consolidate styles-only queue at the top

This effectively reverts d6b4d3c537 and declines T97420.
This was previously attempted in b7c0e537eb.

Drop support for position "bottom" for addModuleStyles().
This feature was only recently introduced with the intent
to optimise page load performance, but had an adverse effect.

It increases chances of FOUC due to late discovery of these styles.
It also caused minor problems for some gadgets and extensions
that did not or were unable to set these flags. Some mobile
code was introduced around the same time as this feature and
was never given position=top.

Stylesheets that don't affect initial render or are only needed
on interaction should be loaded via addModules() instead; which
is handled by the asynchronous loader in JavaScript.

Change-Id: Ib9821b7b87cfc8a59062bb6ca358974fdb01ced1

8 years agoMerge "Language::truncate(): don't chop up multibyte characters when input contains...
jenkins-bot [Tue, 27 Oct 2015 03:33:15 +0000 (03:33 +0000)]
Merge "Language::truncate(): don't chop up multibyte characters when input contains newlines"

8 years agoGet rid of CSS transitions on form elements in mediawiki.ui
Ori Livneh [Tue, 27 Oct 2015 03:28:21 +0000 (20:28 -0700)]
Get rid of CSS transitions on form elements in mediawiki.ui

They seem to serve no function whatsoever other than to irritate and delay the
loading of the page.

Change-Id: I54c195541713a5bfbc8bd7078499ac49671697c6

8 years agoLanguage::truncate(): don't chop up multibyte characters when input contains newlines
Roan Kattouw [Tue, 27 Oct 2015 03:17:37 +0000 (20:17 -0700)]
Language::truncate(): don't chop up multibyte characters when input contains newlines

To detect whether the truncation had chopped up a multibyte
character after the first byte, a regex was used. But in this
regex, the dot (.) didn't match newlines, so it failed to
detect chopped multibyte characters (after the first byte)
if there was a newline preceding the chopped character.

Bug: T116693
Change-Id: I66e4fd451acac0a1019da7060d5a37d70963a15a

8 years agoMerge "Migrate more callers away from $wgMemc"
jenkins-bot [Tue, 27 Oct 2015 01:44:43 +0000 (01:44 +0000)]
Merge "Migrate more callers away from $wgMemc"

8 years agoMerge "Remove begin/commit transaction calls in refreshLinks.php"
jenkins-bot [Tue, 27 Oct 2015 01:19:42 +0000 (01:19 +0000)]
Merge "Remove begin/commit transaction calls in refreshLinks.php"

8 years agoRemove begin/commit transaction calls in refreshLinks.php
aude [Mon, 26 Oct 2015 21:51:01 +0000 (22:51 +0100)]
Remove begin/commit transaction calls in refreshLinks.php

these sometimes lead to issues with database deadlock loops
and probably are not needed here.

Bug: T75456
Change-Id: Iad03f6076d8e319ff02cb26259ec9705105e92a7

8 years agoMerge "Displaying search results for multiple wikis"
jenkins-bot [Tue, 27 Oct 2015 00:07:27 +0000 (00:07 +0000)]
Merge "Displaying search results for multiple wikis"

8 years agoReset serialize_precision to stabilize tests
saper [Mon, 26 Oct 2015 22:44:48 +0000 (23:44 +0100)]
Reset serialize_precision to stabilize tests

With serialize_precision = 100 the following
failures were generated:

1) ApiFormatPhpTest::testGeneralEncoding with data set #7
(array(1.0E+42), 'a:1:{i:0;d:1.0E+42;}', array(1))
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-a:1:{i:0;d:1.0E+42;}
+a:1:{i:0;d:1000000000000000044885712678075916785549312;}

/usr/home/saper/public_html/ybabel/tests/phpunit/includes/api/format/ApiFormatTestBase.php:61
/usr/home/saper/public_html/ybabel/tests/phpunit/MediaWikiTestCase.php:137

2) ApiFormatPhpTest::testGeneralEncoding with data set #30
(array(1.0E+42), 'a:1:{i:0;d:1.0E+42;}', array(2))
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-a:1:{i:0;d:1.0E+42;}
+a:1:{i:0;d:1000000000000000044885712678075916785549312;}

/usr/home/saper/public_html/ybabel/tests/phpunit/includes/api/format/ApiFormatTestBase.php:61
/usr/home/saper/public_html/ybabel/tests/phpunit/MediaWikiTestCase.php:137

Bug: T116683
Change-Id: I5e760b4632d2ab326954fe5769476e143c376d7c

8 years agoJavaScriptContentTest: $wgScript != $wgScriptPath
saper [Mon, 26 Oct 2015 22:05:15 +0000 (23:05 +0100)]
JavaScriptContentTest: $wgScript != $wgScriptPath

Set $wgScript, $wgScriptPath and $wgResourceBasePath
to avoid failures when running on a wiki with
a non-standard $wgScriptPath.

Reported-on:

https://lists.wikimedia.org/pipermail/wikitech-l/2015-October/083675.html

Change-Id: I8acbcca5449060ff5604bf275f690b53343e706e

8 years agoImprove DBReadOnlyError/DBExpectedError page title
Aaron Schulz [Sun, 25 Oct 2015 10:40:44 +0000 (03:40 -0700)]
Improve DBReadOnlyError/DBExpectedError page title

Previously it was just "internal error".

Change-Id: I70d81dfc628b462ab525d83f4a20d899da8ca143

8 years agoMerge "LoggerFactory: Only check for Psr\Log\LoggerInterface once"
jenkins-bot [Mon, 26 Oct 2015 19:56:36 +0000 (19:56 +0000)]
Merge "LoggerFactory: Only check for Psr\Log\LoggerInterface once"

8 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Mon, 26 Oct 2015 19:47:23 +0000 (20:47 +0100)]
Localisation updates from https://translatewiki.net.

Change-Id: I177066ee20e6c31810845cadf7ce6fef9d2ad1ce

8 years agoMerge "Convert doDeleteArticleReal to startAtomic()/endAtomic()"
jenkins-bot [Mon, 26 Oct 2015 19:23:52 +0000 (19:23 +0000)]
Merge "Convert doDeleteArticleReal to startAtomic()/endAtomic()"

8 years agoMerge "Convert MovePage to startAtomic()/endAtomic()"
jenkins-bot [Mon, 26 Oct 2015 19:14:59 +0000 (19:14 +0000)]
Merge "Convert MovePage to startAtomic()/endAtomic()"

8 years agoMerge "PrefixSearch: avoid looking for titles that don't exist"
jenkins-bot [Mon, 26 Oct 2015 19:13:01 +0000 (19:13 +0000)]
Merge "PrefixSearch: avoid looking for titles that don't exist"

8 years agoConvert doDeleteArticleReal to startAtomic()/endAtomic()
Aaron Schulz [Wed, 7 Oct 2015 18:48:23 +0000 (11:48 -0700)]
Convert doDeleteArticleReal to startAtomic()/endAtomic()

* They no longer commit the update, but just make sure
  it is part of a transaction. The BEGIN/COMMIT will
  happen at request start/end given DBO_TRX or in this
  method otherwise (like when in CLI mode). This avoids
  premature committing of other transactions.
* FileDeleteForm was the only caller using $commit=false
  for WikiPage::doDeleteArticleReal() and its proxies
  WikiPage::doDeleteArticle() and Article::doDeleteArticle().
  The ugly $commit flag is now removed.
* No caller was using $id for WikiPage::doDeleteArticleReal()
  and its proxies WikiPage::doDeleteArticle() and
  Article::doDeleteArticle(). It is now removed and we can
  be sure the lock() and CAS logic always hit in the method.
  The rollback() calls are not needed given the page row lock
  and having them there could break outer transactions.
* Updated FileDeleteForm to use startAtomic()/endAtomic() so
  the article and file delete are still wrapped in a
  transaction. Note that LocalFile::delete() does reference
  counting and trxLevel() checks so it will not try to begin()
  and break FileDeleteForm's transaction via startAtomic().
* Moved less important 'page-recent-delete' key update down
  for sanity in case it blows up.

Change-Id: Idb98510506c0edd02236c30badaec97d86e07696

8 years agoMigrate more callers away from $wgMemc
Aaron Schulz [Mon, 26 Oct 2015 07:41:05 +0000 (00:41 -0700)]
Migrate more callers away from $wgMemc

Callers should use more expliciy lazy-loaded
cache factory methods.

Change-Id: Ifa0bf389720a09a931ee6466b993f787d83a09a7

8 years agoMerge "Update grunt-jsonlint to 1.0.5"
jenkins-bot [Mon, 26 Oct 2015 19:05:18 +0000 (19:05 +0000)]
Merge "Update grunt-jsonlint to 1.0.5"

8 years agoMerge "ApiBase::PARAM_DFLT => null is the default anyway"
jenkins-bot [Mon, 26 Oct 2015 19:02:33 +0000 (19:02 +0000)]
Merge "ApiBase::PARAM_DFLT => null is the default anyway"

8 years agoLoggerFactory: Only check for Psr\Log\LoggerInterface once
Bryan Davis [Sat, 24 Oct 2015 22:05:21 +0000 (16:05 -0600)]
LoggerFactory: Only check for Psr\Log\LoggerInterface once

LoggerFactory::getInstance() will be called many times during the course
of handling a typical MediaWiki request. The interface_exists() guard
condition it uses is an attempt to provide an informative error message
when Composer managed libraries are not installed. This check is only
needed on the first invocation of getInstance() to be effective. Using
an additional boolean to guard the interface_exists() call will allow
the PHP runtime to avoid a potentially expensive (at least compared to
a static boolean comparison) function call.

This is the sort of thing that smells of premature optimization, but its
addition is in fact informed by examination of performance reports from
the Wikimedia production environment.

Bug: T115729
Change-Id: I437bcb5326b06145081f2b86f6c4d0c8dc1a318c

8 years agoPrefixSearch: avoid looking for titles that don't exist
Chad Horohoe [Mon, 26 Oct 2015 18:50:23 +0000 (11:50 -0700)]
PrefixSearch: avoid looking for titles that don't exist

WikiPage::getRedirectTarget() can very easily return null. Don't
blow up when that happens.

Properly document PrefixSearch::getRedirectTarget() while we're
here.

Bug: T116029
Change-Id: Ib509e8e3e6ec04a787de3857a4b5ee9b01560559

8 years agoresourceloader: Deduplicate module registration conflicts
Ori Livneh [Mon, 26 Oct 2015 18:23:43 +0000 (11:23 -0700)]
resourceloader: Deduplicate module registration conflicts

If an attempt is made to register a ResourceLoader module which has already
been registered, instead of bailing with an error, issue a warning instead, and
allow the lattermost set of module parameters to stick.

Because modules are registered from extensions, and because modules are often
migrated from one extension to another as extensions are refactored, and
because the developers of different extensions are not always aware of each
other's work, throwing an error runs a high risk of causing an outage.

Bug: T116628
Change-Id: Ie3499d9f2ff3bf071f1c2b0176e19440ff55211c

8 years agofilebackend: Remove some old Content-Disposition b/c code
Aaron Schulz [Mon, 26 Oct 2015 18:13:58 +0000 (11:13 -0700)]
filebackend: Remove some old Content-Disposition b/c code

Change-Id: I6af4a84bd549e2bfb1b110fa790f499d144f236b

8 years agoMake Swift backend respect Content-Type in create/store
Aaron Schulz [Mon, 26 Oct 2015 18:16:18 +0000 (11:16 -0700)]
Make Swift backend respect Content-Type in create/store

Change-Id: I479d1fc4f261bdcdc380404db0cb2f2397877759

8 years agoMerge "Make DateFormatter::getInstance use APC"
jenkins-bot [Mon, 26 Oct 2015 17:46:53 +0000 (17:46 +0000)]
Merge "Make DateFormatter::getInstance use APC"

8 years agoMerge "Convert getMagickVersion() to using APC"
jenkins-bot [Mon, 26 Oct 2015 17:40:25 +0000 (17:40 +0000)]
Merge "Convert getMagickVersion() to using APC"

8 years agoMerge "Make sure, that a tags and input tags with mw-ui-button has the same height"
jenkins-bot [Mon, 26 Oct 2015 17:37:23 +0000 (17:37 +0000)]
Merge "Make sure, that a tags and input tags with mw-ui-button has the same height"

8 years agoMerge "Installer: use _MainCacheType form variable"
jenkins-bot [Mon, 26 Oct 2015 17:32:52 +0000 (17:32 +0000)]
Merge "Installer: use _MainCacheType form variable"

8 years agoMerge "mw.ForeignStructuredUpload: Mark description as being in source wiki's content...
jenkins-bot [Mon, 26 Oct 2015 17:21:59 +0000 (17:21 +0000)]
Merge "mw.ForeignStructuredUpload: Mark description as being in source wiki's content language"

8 years agoInstaller: use _MainCacheType form variable
saper [Fri, 23 Oct 2015 21:29:38 +0000 (23:29 +0200)]
Installer: use _MainCacheType form variable

Do not use "wgMainCacheType" form variable
name that contains values that cannot be
assigned to $wgMainCacheType

Bug: T116375
Change-Id: I83459c8006cc4c1bcdeaa0d78a1230687c95db46

8 years agomw.ForeignStructuredUpload: Mark description as being in source wiki's content language
Bartosz Dziewoński [Mon, 26 Oct 2015 17:08:36 +0000 (18:08 +0100)]
mw.ForeignStructuredUpload: Mark description as being in source wiki's content language

Bug: T116395
Change-Id: Id701ee053be226e9ed1791cbb59459d372ac7255

8 years agoChanged paths to package dependency file
Perside Rosalie [Sun, 25 Oct 2015 23:55:47 +0000 (00:55 +0100)]
Changed paths to package dependency file

Paths to ./composer.lock is changed to ./vendor/composer/installed.json
and dependency information now is read from the installed.json file.
A new ComposerInstalled class has been declared and uses the class now
to access the getInstalledDependencies() method to read data

Bug: T106247
Change-Id: Ic216577bb19b4fc5832ba003fcbbe9195d707b41

8 years agoTitleOptionWidget: Only set grey bg for icons
Ed Sanders [Mon, 26 Oct 2015 14:51:15 +0000 (14:51 +0000)]
TitleOptionWidget: Only set grey bg for icons

When a thumbanil image is used leave the background
transparent, as the thumbnail may have transparency.

Bug: T116588
Change-Id: Id7bd55fcdce337cfcf3f6d9aedc798630e2983c2

8 years agoMerge "Special:Upload Fire wikipage.content hook"
jenkins-bot [Mon, 26 Oct 2015 12:32:57 +0000 (12:32 +0000)]
Merge "Special:Upload Fire wikipage.content hook"

8 years agoConvert getMagickVersion() to using APC
Aaron Schulz [Mon, 26 Oct 2015 08:15:09 +0000 (01:15 -0700)]
Convert getMagickVersion() to using APC

Shelling out on my slow vagrant VM takes about ~3-4ms
so it's probably not worth a  fallback.

Change-Id: Ifd5758264cc15f1ae07972e839a243f5f891503e

8 years agoConvert ForeignApiRepo::httpGetCached() to the WAN cache
Aaron Schulz [Mon, 26 Oct 2015 08:05:08 +0000 (01:05 -0700)]
Convert ForeignApiRepo::httpGetCached() to the WAN cache

Change-Id: I4f1098a6e98570fc4fea6941ffcd64540d6caebd

8 years agoMake DateFormatter::getInstance use APC
Aaron Schulz [Mon, 26 Oct 2015 07:59:10 +0000 (00:59 -0700)]
Make DateFormatter::getInstance use APC

Change-Id: Idfff805903bffcdd6ff8f2a3c1331ca63476933e

8 years agoMerge "Remove unused fields from User"
jenkins-bot [Mon, 26 Oct 2015 07:36:19 +0000 (07:36 +0000)]
Merge "Remove unused fields from User"

8 years agoRemove unused fields from User
Aaron Schulz [Sun, 25 Oct 2015 18:35:33 +0000 (11:35 -0700)]
Remove unused fields from User

Change-Id: Ib209747f1ebd1433969b13b1ecb86d3b57f9be9a

8 years agoMerge "In UploadStash, prioritize core metadata over file handler metadata"
jenkins-bot [Mon, 26 Oct 2015 07:14:54 +0000 (07:14 +0000)]
Merge "In UploadStash, prioritize core metadata over file handler metadata"

8 years agoMerge "clone is not a function"
jenkins-bot [Mon, 26 Oct 2015 07:01:54 +0000 (07:01 +0000)]
Merge "clone is not a function"

8 years agoPreprocessor: Use correct cache prefix for the subclass
Kevin Israel [Mon, 26 Oct 2015 01:29:47 +0000 (21:29 -0400)]
Preprocessor: Use correct cache prefix for the subclass

Follows-up 1559be9f7aef, which caused "Preprocessor" to be used as the
cache prefix for all subclasses, by using late static binding to access
the constant. Though use of that feature has been discouraged[1], this
change is a straightforward bug fix, and any improvements can be made
separately.

[1]: https://www.mediawiki.org/wiki/Manual:Coding_conventions/PHP#Late_static_binding

Change-Id: Ib25e1908a6373f6675659a0906e12d4a38af014c

8 years agoMerge "Database::__construct(): Don't set $mTrxAtomicLevels to an SplStack"
jenkins-bot [Sun, 25 Oct 2015 23:17:51 +0000 (23:17 +0000)]
Merge "Database::__construct(): Don't set $mTrxAtomicLevels to an SplStack"

8 years agoConsolidate common Preprocessor caching code
Ori Livneh [Thu, 8 Oct 2015 20:54:15 +0000 (13:54 -0700)]
Consolidate common Preprocessor caching code

* Consolidate nearly-identical caching code in Preprocessor_DOM and
  Preprocessor_Hash by making Preprocessor an abstract class rather than an
  interface and by implementing Preprocessor::cacheSetTree() and
  Preprocessor::cacheGetTree().
* Cache trees for wikitext blobs that have length equal or greater to
  PreprocessorCacheThreshold. Previously they needed to be greater than
  PreprocessorCacheThreshold, so this changes the requirement by one character.
  I did it because it seems more natural.
* Modernize the code to use singleton service objects rather than globals.

We spend a lot of time in the Preprocessor, so it would be nice for this code
to be well-factored and clear.

Change-Id: Ib71c29f14a28445a505e12c774a24ad964330b95

8 years agoDatabase::__construct(): Don't set $mTrxAtomicLevels to an SplStack
Kevin Israel [Sun, 25 Oct 2015 23:02:15 +0000 (19:02 -0400)]
Database::__construct(): Don't set $mTrxAtomicLevels to an SplStack

Follows-up db0b9ef2649c and 01ef30fcc495.

Change-Id: I06188c746fb885819aa93e0e3caf3dc2bac7ae72

8 years agoMerge "Update CACHE_MEMCACHED to not used newMemcached"
jenkins-bot [Sun, 25 Oct 2015 21:33:04 +0000 (21:33 +0000)]
Merge "Update CACHE_MEMCACHED to not used newMemcached"

8 years agoSpecial:Upload Fire wikipage.content hook
Derk-Jan Hartman [Sun, 25 Oct 2015 19:25:08 +0000 (20:25 +0100)]
Special:Upload Fire wikipage.content hook

The warning here is a fragment of wikicode, and can include the video
player for instance.

Bug: T51751
Change-Id: I45e10f5f5700ea7c526a63b4f47a21d630c6d8ee

8 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sun, 25 Oct 2015 20:48:12 +0000 (21:48 +0100)]
Localisation updates from https://translatewiki.net.

Change-Id: I82484aa5a52137eadc2cae6a7355fef38f089977

8 years agoMerge "installer: Remove additional newline in LocalSettings.php"
jenkins-bot [Sun, 25 Oct 2015 20:33:04 +0000 (20:33 +0000)]
Merge "installer: Remove additional newline in LocalSettings.php"

8 years agoinstaller: Remove additional newline in LocalSettings.php
saper [Fri, 23 Oct 2015 20:09:04 +0000 (22:09 +0200)]
installer: Remove additional newline in LocalSettings.php

Change-Id: I6a0630d109c0ab4299507d125e4e1748055bcd58

8 years agoMerge "Cleanup on Special:AllPages and Special:PrefixIndex"
jenkins-bot [Sun, 25 Oct 2015 18:41:56 +0000 (18:41 +0000)]
Merge "Cleanup on Special:AllPages and Special:PrefixIndex"

8 years agoUpdate CACHE_MEMCACHED to not used newMemcached
Aaron Schulz [Sun, 25 Oct 2015 18:24:16 +0000 (11:24 -0700)]
Update CACHE_MEMCACHED to not used newMemcached

* Follow up to 0dd27b1da9e45
* Also removed that method, which is not used by callers

Bug: T116541
Change-Id: Ic6e4e25089de112cfd263fb042d654ee06970859