lhc/web/wiklou.git
10 years agoIn maintenance/postgres/tables.sql, the profiling table should be defined like
Jeff Janes [Tue, 15 Oct 2013 20:19:10 +0000 (20:19 +0000)]
In maintenance/postgres/tables.sql, the profiling table should be defined like
this:

CREATE TABLE profiling (
  pf_count   INTEGER         NOT NULL DEFAULT 0,
  pf_time    FLOAT           NOT NULL DEFAULT 0,
  pf_memory  FLOAT           NOT NULL DEFAULT 0,
  pf_name    TEXT            NOT NULL,
  pf_server  TEXT            NULL
);

The current use of NUMERIC(18,10) very rapidly overflows the pf_memory column,
generating errors.  Also, the NUMERIC is very much slower than float, and in
this case it has no advantages.

Bug: 55722
Change-Id: I48b00d55aaed821a4ceb9365033817a3b477d71a

10 years agoLocalisation updates from http://translatewiki.net.
Translation updater bot [Tue, 15 Oct 2013 19:19:21 +0000 (19:19 +0000)]
Localisation updates from translatewiki.net.

Change-Id: Ie45e695bf4dc5fc8177ed33e400f7ca2000519a0

10 years agoMerge "Remove comment which is plainly wrong"
jenkins-bot [Tue, 15 Oct 2013 18:39:08 +0000 (18:39 +0000)]
Merge "Remove comment which is plainly wrong"

10 years agoRemove comment which is plainly wrong
jeroendedauw [Tue, 15 Oct 2013 18:31:34 +0000 (20:31 +0200)]
Remove comment which is plainly wrong

Change-Id: I89bb9243a19e0355260e4e1c217e3868014c4886

10 years agoMerge "Expose changed links in LinksUpdate"
jenkins-bot [Tue, 15 Oct 2013 17:53:12 +0000 (17:53 +0000)]
Merge "Expose changed links in LinksUpdate"

10 years agoExpose changed links in LinksUpdate
Nik Everett [Wed, 9 Oct 2013 18:48:37 +0000 (18:48 +0000)]
Expose changed links in LinksUpdate

These links are only really available during the LinksUpdateComplete
hook.

To make sure they are always available this also removes dump links
updates which would prevent this data from being built.

Change-Id: I115f8cf9d3b0a1dba979ceb58b5f14dd0b76ec49

10 years agoAdd vform format to HTMLForm, use in PasswordReset
S Page [Wed, 26 Jun 2013 06:03:17 +0000 (23:03 -0700)]
Add vform format to HTMLForm, use in PasswordReset

This adds a new 'vform' display format to HTMLForm which styles forms
using it in the new compact stacked vertical format:
* Applies class mw-ui-vform to the form.
* Gives Submit button 'mw-ui-{button,big,block,primary}' classes and
  spaced block styling.
* Styles the error class.
* HTMLForm divs are too nested to get styling "for free", so add
  .mw-ui-vform-div selector to Agora CSS and apply this class to form
  divs (maybe not ideal fix).
* HTMLCheckField nests the checkbox inside label.
* Add method to setShowEmptyLabel(); vform format sets this false as it
  doesn't want generated HTML for empty labels adding vertical space.

In FormSpecialPage, don't set the wrapper legend with its old-school
line around the form if in vform style.

Build new mediawiki.ui CSS with the .mw-ui-vform-div styling

Special:PasswordReset requests the new styling with setDisplayFormat( 'vform' )
and turns off the wrapper legend.

(This version of the patch doesn't switch the default format of HTMLForm,
individual forms have to choose it.)

Notes are at
https://www.mediawiki.org/wiki/Agora/Engineering#HTMLForm_Issues

Change-Id: Id03d185bbee990595bfc469a61163cc598fc3441

10 years agoMerge "Vector: New beta module with new typography styles"
jenkins-bot [Tue, 15 Oct 2013 16:34:44 +0000 (16:34 +0000)]
Merge "Vector: New beta module with new typography styles"

10 years agoAdd configurable delay between purgeChangedPages batches
Bryan Davis [Fri, 11 Oct 2013 19:42:10 +0000 (13:42 -0600)]
Add configurable delay between purgeChangedPages batches

UDP flooding is possible when purging large numbers of files. This
change adds a command line switch to the purgeChangedPages.php
maintenance script to insert an artificial delay between purge batches.
The intent is to allow the network time to process the batch that was
just sent before flooding with a second batch.

`--sleep-per-batch` can be used in combination with `--batch-size` to
manage network and to some extent query load. A suggested starting point
would be to use `--sleep-per-batch=500` in concert with the default
batch size of 100 to target a maximum rate of 200 packets/second.

Bug: 55632
Change-Id: Ibfc54b1767f145098465404a2b23cd92852e41fd

10 years agoSimplified IPv6 regex per comment
Aaron Schulz [Fri, 31 May 2013 23:12:18 +0000 (16:12 -0700)]
Simplified IPv6 regex per comment

* We already require PHP 5.3.2, which includes PCRE 7.2+.
  PHP 5.2.4 includes PCRE 7.2 per http://php.net/ChangeLog-5.php.

Change-Id: Ie9c1a0a93bef30a3a67e0140e621814351f8cea1

10 years agoresourceloader: Don't catch LESS error in ResourceLoaderFileModule
Timo Tijhof [Tue, 8 Oct 2013 21:47:42 +0000 (23:47 +0200)]
resourceloader: Don't catch LESS error in ResourceLoaderFileModule

Instead let it throw up to ResourceLoader::makeModuleResponse.. By using
the central logic for exception handling the parse error becomes more
discoverable and obvious.

* The module is marked as in "error" state (currently it would still serve
  the result of file A and C, even if file B has a parse error).
  This matches the behaviour of the javascript checker we have.
* The exception comment is produced on top of the load.php response
  (where users expect it) instead of buried somewhere between the
  different modules and the different files within the modules.
* The exception comment will not be stripped out by CSSMin.
* DRY :)

Without this, debugging less parse errors is harder than it should be.

Bug: 55442
Change-Id: I6510b43f02cf82568b7fd2421209a8e636d5e115

10 years agoMerge "Refresh Deletereason-dropdown"
jenkins-bot [Mon, 14 Oct 2013 13:16:33 +0000 (13:16 +0000)]
Merge "Refresh Deletereason-dropdown"

10 years agoMerge "Add APIQuerySiteInfoStatisticsInfo hook"
jenkins-bot [Mon, 14 Oct 2013 13:14:35 +0000 (13:14 +0000)]
Merge "Add APIQuerySiteInfoStatisticsInfo hook"

10 years agoDocument class property and break long lines
Siebrand Mazeland [Mon, 7 Oct 2013 09:32:05 +0000 (11:32 +0200)]
Document class property and break long lines

Change-Id: Id391dc8911de8b6df0fb95cba58cffee972ca507

10 years agoRefresh Deletereason-dropdown
This, that and the other [Mon, 14 Oct 2013 10:54:12 +0000 (21:54 +1100)]
Refresh Deletereason-dropdown

I went around to a few MW installations on the web, and all that had
modified this message added "Spam". (Also per the bug.) And "Broken
redirect" seems a sensible, universal addition as well.

Also putting in order of "commonness" and fixing the inconsistent spacing
of the bulleted list - it annoys me every time.

Bug: 47573
Change-Id: If50f30df95f969f0b56a9058fc57e7c542b7215a

10 years agoLocalisation updates from http://translatewiki.net.
Translation updater bot [Mon, 14 Oct 2013 09:28:56 +0000 (09:28 +0000)]
Localisation updates from translatewiki.net.

Change-Id: I2e39d39032e0a7fb32b9f5385f95f3047bbdb264

10 years agoexception: Move logging logic to static method of MWExceptionHandler
Timo Tijhof [Wed, 9 Oct 2013 00:20:41 +0000 (02:20 +0200)]
exception: Move logging logic to static method of MWExceptionHandler

Follows-up c28251a9fd, which unconditionally called logException
on objects that aren't always instances of MWException.

This makes it possible to, for example, log PHP errors or errors
from Less in ResourceLoader to be logged as well (which naturally
don't have a logException method).

As a result of the handling now being generic, non-MWException
errors will now be loggable, and also have their ID fixed between
HTML output and the debug log entry.

* Not yet removing MWException::getLogMessage (introduced in bcb9f9e1c)
  as it has been around since 2006 (released in 1.8.0).

* Not yet removing MWException::getLogId (introduced in 70841c5867)
  as it was part of the 1.20.0 release.

* Removed MWException::logException (introduced in c28251a9fd)
  as it was only added a few weeks ago within this release cycle.

Change-Id: Iab98e3a7a9b78d8602e69e0571b35cf107a96b72

10 years agovector: Apply coding conventions to screen.less and minor cleanup
Timo Tijhof [Tue, 8 Oct 2013 00:40:24 +0000 (02:40 +0200)]
vector: Apply coding conventions to screen.less and minor cleanup

Follows-up 08cf0b17e953bbe.

* Removed obsolete comment about @embed, since this file no longer
  uses that.

* Removed ".less" per LESS convention.

* Made whitespace consistent with coding conventions.
  No spaces inside .transition(), just like there are no spaces
  in .background-image() or url().

* Line breaks between different rules.

Change-Id: I5956d179eb46f6ee4e0c313eafe008c434e61e31

10 years agoRemove calls to deprecated HTMLForm#setTitle
Bartosz Dziewoński [Fri, 27 Sep 2013 20:52:44 +0000 (22:52 +0200)]
Remove calls to deprecated HTMLForm#setTitle

Use DerivativeContext with modified title instead.

Most of those should be using FormSpecialPage…

Change-Id: Ia66f3b4b22866cc4ac4ac7b1f2fc2a4b1a9e73f6

10 years agoRename SpecialRecentChanges::addRecentChangesJS() to addModules()
Bartosz Dziewoński [Sat, 12 Oct 2013 18:45:07 +0000 (20:45 +0200)]
Rename SpecialRecentChanges::addRecentChangesJS() to addModules()

…and make it protected. It makes no sense to include class name in the
function name, especially since subclasses might want to customize it.

Change-Id: Ic0d23f4400b88596fdb11f6c0d8aefc9aea589ba

10 years agoSpecialRecentChanges: Don't call getUser() repeatedly in getDefaultOptions()
Bartosz Dziewoński [Sat, 12 Oct 2013 00:41:47 +0000 (02:41 +0200)]
SpecialRecentChanges: Don't call getUser() repeatedly in getDefaultOptions()

Change-Id: If0ec42e89887c98968cd7878e45b1944e9fdf7ac

10 years agoSpecialWatchlist: Remove old irrelevant comment
Bartosz Dziewoński [Fri, 11 Oct 2013 21:01:57 +0000 (23:01 +0200)]
SpecialWatchlist: Remove old irrelevant comment

The code it was commenting has been removed in r10652 in 2005…

Change-Id: I33846196c1f62800db2a37b6b03bdb47280af7d4

10 years agoSpecialWatchlist: Remove dead cutoff code
Bartosz Dziewoński [Fri, 11 Oct 2013 19:42:23 +0000 (21:42 +0200)]
SpecialWatchlist: Remove dead cutoff code

Added back in r1532, it got broken in one of the numerous refactors
since then and now only triggers when 'days' request parameter is
passed explicitly and is malformed.

Just use floatval() instead.

Change-Id: I20c1e816a11fca5037af93bf81b46839f2a5efb0

10 years agoLocalisation updates from http://translatewiki.net.
Translation updater bot [Sun, 13 Oct 2013 19:20:40 +0000 (19:20 +0000)]
Localisation updates from translatewiki.net.

Change-Id: I3b0c0763a0f2a7b40c4b25821cffac6b136ea6af

10 years agoEnsure that $call['args'] is set before using it
Kevin Israel [Sun, 13 Oct 2013 13:49:03 +0000 (09:49 -0400)]
Ensure that $call['args'] is set before using it

Fixes PHP Notice:  Undefined index: args in /home/ki/Projects/mediawiki/
core/includes/Exception.php on line 755 when running code from
maintenance/eval.php .

Change-Id: Ic4a806232aadae0a60f5bc06de1604d9c5996e6f

10 years agoPass Context to User::resetOptions
umherirrender [Sat, 12 Oct 2013 20:48:26 +0000 (22:48 +0200)]
Pass Context to User::resetOptions

Change-Id: I0444777697ed9a8b8afdd0e5a96841848b162a7a

10 years agoMerge "Add bot to createAndPromote.php groups"
jenkins-bot [Sat, 12 Oct 2013 19:26:46 +0000 (19:26 +0000)]
Merge "Add bot to createAndPromote.php groups"

10 years agoLocalisation updates from http://translatewiki.net.
Translation updater bot [Sat, 12 Oct 2013 18:42:51 +0000 (18:42 +0000)]
Localisation updates from translatewiki.net.

Change-Id: I018c32bec9b2b04590657afd96606ed473cdfed6

10 years agoMerge "Revert visibility change to HTMLForm $typeMappings"
jenkins-bot [Sat, 12 Oct 2013 17:20:38 +0000 (17:20 +0000)]
Merge "Revert visibility change to HTMLForm $typeMappings"

10 years agoUpdate formatting
Siebrand Mazeland [Sat, 12 Oct 2013 15:35:26 +0000 (17:35 +0200)]
Update formatting

Change-Id: If3dd6a1ac4b16479244a847420f0488ba8c51e2b

10 years agoFormOptions: More documentation!
Bartosz Dziewoński [Sat, 12 Oct 2013 14:56:41 +0000 (16:56 +0200)]
FormOptions: More documentation!

Change-Id: I088b07c1672426c45d995fdf96ac7fc7bda21307

10 years agoRevert visibility change to HTMLForm $typeMappings
S Page [Sat, 12 Oct 2013 08:10:24 +0000 (01:10 -0700)]
Revert visibility change to HTMLForm $typeMappings

Change Id5668141835e22e3e1b043109e50d73ccd6b1229 changed the visibility
of static $typeMappings to private.  It turns out this breaks
http://www.blue-spice.org/ who want to add their own HTMLForm types and
have no way to extend or override this except by changing it.  So set it
to public static.

As https://www.mediawiki.org/wiki/Manual:Coding_conventions/PHP says,
"It's generally a good idea to avoid visibility changes unless you're
making changes to the function which would break old uses of it anyway."
That trumps PHP CodeSniffer warnings.

Change-Id: Ife82596e96a4650b977422aae6b32f24a392d5fb

10 years agoAdd APIQuerySiteInfoStatisticsInfo hook
Kunal Mehta [Sat, 5 Oct 2013 21:32:08 +0000 (14:32 -0700)]
Add APIQuerySiteInfoStatisticsInfo hook

Allows extensions to modify the output of
action=query&meta=siteinfo&siprop=statstics

Accompanies the SpecialStatsAddExtra hook for Special:Statistics

Change-Id: I712748077a0ac2fb729bfe3b6616ac4981cb754e

10 years agoModernize SquidUpdate php code
Bryan Davis [Fri, 11 Oct 2013 22:41:59 +0000 (16:41 -0600)]
Modernize SquidUpdate php code

- Update to PHP5 object coding style
- Fix @param comments using wrong argument order
- Add some phpdoc comments

Change-Id: Ia3190a6276e807ebef4f4aaeedc0e39819dc992a

10 years agoMerge "Blacklist Nokia's Ovi Browser from ResourceLoader"
jenkins-bot [Fri, 11 Oct 2013 20:36:06 +0000 (20:36 +0000)]
Merge "Blacklist Nokia's Ovi Browser from ResourceLoader"

10 years agoBlacklist Nokia's Ovi Browser from ResourceLoader
Max Semenik [Fri, 11 Oct 2013 15:49:04 +0000 (19:49 +0400)]
Blacklist Nokia's Ovi Browser from ResourceLoader

It runs scripts proxy-side much like Opera Mini does, resulting in nothing
resembling a real JS engine. This causes problems and the browser is popular
enough to warrant a block.

Bug: 55600

Change-Id: I2c1ee78828c2b9cead4f82ef795972a4c28140b4

10 years agoLocalisation updates from http://translatewiki.net.
Translation updater bot [Fri, 11 Oct 2013 19:10:32 +0000 (19:10 +0000)]
Localisation updates from translatewiki.net.

Change-Id: I8f4d44a3917bc7264d7dacc4b1e75641dab845c0

10 years agoMerge "exception: Account for $call['file'] and $call['line'] being unset"
jenkins-bot [Fri, 11 Oct 2013 18:50:51 +0000 (18:50 +0000)]
Merge "exception: Account for $call['file'] and $call['line'] being unset"

10 years agoexception: Account for $call['file'] and $call['line'] being unset
Timo Tijhof [Fri, 11 Oct 2013 18:18:07 +0000 (20:18 +0200)]
exception: Account for $call['file'] and $call['line'] being unset

Bug: 55634
Change-Id: I1173216cade73216848816f6bb51e54096abdfde

10 years agoMerge "Add script to purge changed files from cache"
jenkins-bot [Fri, 11 Oct 2013 18:28:29 +0000 (18:28 +0000)]
Merge "Add script to purge changed files from cache"

10 years agoMerge "mw.inspect: decline to report module sizes when in debug mode"
jenkins-bot [Fri, 11 Oct 2013 17:27:45 +0000 (17:27 +0000)]
Merge "mw.inspect: decline to report module sizes when in debug mode"

10 years agoMerge "FormatJson: minor cleanup"
jenkins-bot [Fri, 11 Oct 2013 17:26:03 +0000 (17:26 +0000)]
Merge "FormatJson: minor cleanup"

10 years agoMerge "Add an explicit targets declaration for mediawiki.inspect & $.byteLength"
jenkins-bot [Fri, 11 Oct 2013 16:31:10 +0000 (16:31 +0000)]
Merge "Add an explicit targets declaration for mediawiki.inspect & $.byteLength"

10 years agoAdd an explicit targets declaration for mediawiki.inspect & $.byteLength
Ori Livneh [Fri, 11 Oct 2013 08:31:00 +0000 (01:31 -0700)]
Add an explicit targets declaration for mediawiki.inspect & $.byteLength

Jon Robson said[1] he'd be interested in making mediawiki.inspect usable on
the mobile site by specifying both mobile & desktop targets explicitly in the
resource declaration. That's what this patch does. The cost to this is very
minimal because the module is never loaded by default. mw.loader.inspect()
wraps the call to the inspector with an mw.loader.using() call that causes the
module to be retrieved. It is not retrieved otherwise.

[1]: http://lists.wikimedia.org/pipermail/wikitech-l/2013-October/072381.html

Change-Id: I7cf292d3b8fb554bd1fc2143ca45399efccb70aa

10 years agomw.inspect: decline to report module sizes when in debug mode
Ori Livneh [Fri, 11 Oct 2013 10:44:33 +0000 (03:44 -0700)]
mw.inspect: decline to report module sizes when in debug mode

- In debug mode, 1 resource = 1 request, so module size is easier to determine
  via the network view of the developer tools in Firefox & WebKit browsers.
- Determining the module size in debug mode in JavaScript would require
  modifying core ResourceLoader code or re-fetching each resource with a
  separate XHR to measure its size.
- It's not worth it.

Bug: 55553
Change-Id: I73d1bb4141c1b6ed64a72fdc416048937a2e1146

10 years agomediawiki.page.gallery: Clean up documentation for hook
Timo Tijhof [Sun, 6 Oct 2013 22:15:36 +0000 (00:15 +0200)]
mediawiki.page.gallery: Clean up documentation for hook

Follows-up 14b3f87.

Change-Id: Ia917516d985a6e6f6e4bbca9ea8b5437175a6aa8

10 years agoVector: New beta module with new typography styles
jrobson [Thu, 3 Oct 2013 20:22:14 +0000 (13:22 -0700)]
Vector: New beta module with new typography styles

To enable install Extension:BetaFeatures and Extension:VectorBeta
in LocalSettings.php

Changes to core:
* Refactor screen.less to make use of variables

Introduce dormant skins.vector.beta module
* Activated by https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/VectorBeta
* Load different environment variables depending on whether in a beta
  experiment or not
* Switch global fonts for text from browser default sans-serif to a
  specific sans-serif stack.
* Switch global fonts for headings to Georgia/serif
* Cleanup over-specific specifiers in process
* Adjust styling of navigation menus to focus on content
* Adjust styling of collapsible navigation menu to be less prominent

See https://www.mediawiki.org/wiki/Wikimedia_Foundation_Design/Typography

Change-Id: Ica0b69ad95051e15cd8ed9888927e034c13fbf92

10 years agoMerge "Do not set wgServer in cli install unless explicitly passed"
jenkins-bot [Thu, 10 Oct 2013 22:12:55 +0000 (22:12 +0000)]
Merge "Do not set wgServer in cli install unless explicitly passed"

10 years agoMerge "Made JobQueueDB use getConnectionRef()"
jenkins-bot [Thu, 10 Oct 2013 20:54:37 +0000 (20:54 +0000)]
Merge "Made JobQueueDB use getConnectionRef()"

10 years agoLocalisation updates from http://translatewiki.net.
Translation updater bot [Thu, 10 Oct 2013 19:03:14 +0000 (19:03 +0000)]
Localisation updates from translatewiki.net.

Change-Id: I6ed3b4bc205bb8b6a09aea841a73aa0d8e317554

10 years agoMerge "Handle raw <h#> when calculating $rawtoc"
jenkins-bot [Thu, 10 Oct 2013 18:08:25 +0000 (18:08 +0000)]
Merge "Handle raw <h#> when calculating $rawtoc"

10 years agoDo not set wgServer in cli install unless explicitly passed
YuviPanda [Sun, 6 Oct 2013 19:41:18 +0000 (01:11 +0530)]
Do not set wgServer in cli install unless explicitly passed

Currently, if we do not pass a wgServer value (via --server),
the CLI installer sets the value to the default value
specified in DefaultSettings.php - which is to 'guess' by
calling into WebRequest::detectServer. This yields terrible
results, since WebRequest::detectServer expects to be working
in the context of a Web Request - and hence with HTTP Host
header information. Since calling from the CLI does not give
it host header information, it falls back to 'localhost',
which is not the value you usually want.

If we just do not set wgServer when it is not specified,
it is automatically calculated on every request by
WebRequest::detectServer, which does a splendid job.

Bug: 55376
Change-Id: I5436dd8c340604cbb59406a507188e11c8f86e86

10 years agoRemove silly test cases that are likely to fail
Chad Horohoe [Thu, 10 Oct 2013 01:14:42 +0000 (18:14 -0700)]
Remove silly test cases that are likely to fail

Nobody should be giving objects or arrays to addIdentifierQuotes() anyway

Change-Id: Ibebf5d32196ac5b80cd477aedfef982fd2c9a0e6

10 years agoMerge "Fixed trx isolation bug that could cause text not to be found"
jenkins-bot [Wed, 9 Oct 2013 23:48:05 +0000 (23:48 +0000)]
Merge "Fixed trx isolation bug that could cause text not to be found"

10 years agoMade JobQueueDB use getConnectionRef()
Aaron Schulz [Mon, 7 Oct 2013 16:18:16 +0000 (09:18 -0700)]
Made JobQueueDB use getConnectionRef()

* Also moved insertFields() function up a bit about DB connection methods

Change-Id: I7a9d9c9bc71038fe280542b13e0c0e94bfc4de1e

10 years agoMerge "Made root job de-duplication work without cache setup"
jenkins-bot [Wed, 9 Oct 2013 22:21:20 +0000 (22:21 +0000)]
Merge "Made root job de-duplication work without cache setup"

10 years agoMerge "Escape backticks when quoting MySQL identifiers"
jenkins-bot [Wed, 9 Oct 2013 22:12:26 +0000 (22:12 +0000)]
Merge "Escape backticks when quoting MySQL identifiers"

10 years agoMerge "Add mediawiki.inspect module"
jenkins-bot [Wed, 9 Oct 2013 22:01:19 +0000 (22:01 +0000)]
Merge "Add mediawiki.inspect module"

10 years agoAdd mediawiki.inspect module
Ori Livneh [Tue, 8 Oct 2013 06:08:54 +0000 (23:08 -0700)]
Add mediawiki.inspect module

This patch adds a mediawiki.inspect ResourceLoader module. The module contains
tools for inspecting page composition and performance. It is currently
restricted to a set of static methods for querying the ResourceLoader module
registry, the most useful of which is #inspectLoadedModules, which prints a
list of loaded ResourceLoader modules and their size in kilobytes, ordered from
largest to smallest. This method has a lazy-loading alias: mw.loader.inspect.

Change-Id: I5a007fdf11196664f425cd7800eec7fc3fdb629f

10 years agoEscape backticks when quoting MySQL identifiers
Bryan Davis [Tue, 8 Oct 2013 18:14:52 +0000 (12:14 -0600)]
Escape backticks when quoting MySQL identifiers

Previously mysql_real_escape_string() was improperly used which escapes
for inclusion in a plain string rather than an identifier.

Also adds basic test support for the DatabaseMysqlBase class.

Co-Authored by: Antoine Musso <hashar@free.fr>
Bug: 55427
Change-Id: Ic045e195c89d8d5d0f0edbda0cd1df781de7025c

10 years agoLocalisation updates from http://translatewiki.net.
Translation updater bot [Wed, 9 Oct 2013 19:36:07 +0000 (19:36 +0000)]
Localisation updates from translatewiki.net.

Change-Id: I91e6b1a32aaca18175c97130685a26e9a5704f8d

10 years agoMerge "Fix ForeignAPIRepo::fileExistsBatch()"
jenkins-bot [Wed, 9 Oct 2013 19:11:44 +0000 (19:11 +0000)]
Merge "Fix ForeignAPIRepo::fileExistsBatch()"

10 years agoMerge "Tests for API section editing"
jenkins-bot [Wed, 9 Oct 2013 18:14:09 +0000 (18:14 +0000)]
Merge "Tests for API section editing"

10 years agoTests for API section editing
Kunal Mehta [Sat, 7 Sep 2013 05:56:37 +0000 (22:56 -0700)]
Tests for API section editing

Change-Id: Ibc05c54cd2c9e1775f72dd969e7677b5238e12ad

10 years agoMerge "Remove wfDl() and cleanup everything it touched"
jenkins-bot [Wed, 9 Oct 2013 18:00:43 +0000 (18:00 +0000)]
Merge "Remove wfDl() and cleanup everything it touched"

10 years agoMerge "Fix PHP CodeSniffer warnings and errors"
jenkins-bot [Wed, 9 Oct 2013 17:58:50 +0000 (17:58 +0000)]
Merge "Fix PHP CodeSniffer warnings and errors"

10 years agoRemove wfDl() and cleanup everything it touched
Chad Horohoe [Wed, 9 Oct 2013 16:46:57 +0000 (09:46 -0700)]
Remove wfDl() and cleanup everything it touched

wfDl() is a wrapper around dl(), which is an evil function and
basically only works from the command line of Zend. Luckily
no extension has ever used this thing, so let's just remove it
outright.

For comparison, here's a list of places it does not work:
- hhvm
- php as apache module
- php compiled with zts support
- safe_mode
- Basically any shared host that cares about security

Most callers are using it to check for extension support and are
actually failing gracefully when wfDl() returns false. In these
places we're just going to use extension_loaded().

While we're at it, clean up some of the test skip logic in the
media tests so we can bail as early as possible if we know we
can't complete the test.

This also immediately removes $wgLoadFileinfoExtension. It's been
enabled by default since 5.3 and falls back gracefully when the
support isn't available.

Change-Id: Ieb430dfc74483731dde51d6e20fa700d641ba1f4

10 years agoHandle raw <h#> when calculating $rawtoc
Brad Jorsch [Wed, 9 Oct 2013 15:03:40 +0000 (11:03 -0400)]
Handle raw <h#> when calculating $rawtoc

When the parser is constructing $rawtoc, it needs the sectionIndex
number to be able to calculate the byteoffset. This number is only
available for wikitext headings ("== foo =="), HTML headings
("<h2>foo</h2>") do not have it and the lack makes byteoffset be wrong
for all subsequent headings in the page.

To fix this, we just omit output of byteoffset in this situation.

Bug: 25203
Change-Id: I39e5faa4ac22d915f06125aac36ced11607b94a3

10 years agoFix ForeignAPIRepo::fileExistsBatch()
Brad Jorsch [Wed, 26 Dec 2012 16:55:49 +0000 (11:55 -0500)]
Fix ForeignAPIRepo::fileExistsBatch()

ForeignAPIRepo::fileExistsBatch() is extremely broken:
* If passed an array with numeric keys (e.g. as called from
  FileRepo::fileExists()), it will cache the fact that the item at index
  0 from the first call was found or not found, no matter what the
  actual file being queried is!
* But it doesn't even use its cache correctly. Rather than checking the
  value cached, it just assumes anything that was cached exists.
* It checks whether the page in the remote repository has a description
  page, not whether a file actually exists for the title.
* But it doesn't do that right either, so in the vast majority of cases
  it will decide everything exists.

All of this is offset by the fact that I can't find any code path that
would actually call this function.

Change-Id: I421e8892b642f5267b8dd755183ebd711db83152

10 years agoFixed trx isolation bug that could cause text not to be found
Aaron Schulz [Wed, 9 Oct 2013 17:03:26 +0000 (10:03 -0700)]
Fixed trx isolation bug that could cause text not to be found

* Also added some logging for when revision text is not found

bug: 53687
Change-Id: I0993e8f49d36771cc526fd4afef67455209b8e3a

10 years agoFix PHP CodeSniffer warnings and errors
Siebrand Mazeland [Tue, 8 Oct 2013 17:11:35 +0000 (19:11 +0200)]
Fix PHP CodeSniffer warnings and errors

Also apply formatting convention.

Change-Id: I792210d0d1c5f9089a71cecba95e17822f6da0e3

10 years agoMerge "Remove incorrect span in translation"
jenkins-bot [Wed, 9 Oct 2013 16:21:18 +0000 (16:21 +0000)]
Merge "Remove incorrect span in translation"

10 years agoRemove incorrect span in translation
Siebrand Mazeland [Tue, 8 Oct 2013 16:46:50 +0000 (18:46 +0200)]
Remove incorrect span in translation

Probably originates from a bugged machine translation API.

Change-Id: I39c7d154ffc085991f683de107deb05d730f065d

10 years agoRemove unused local variable
Siebrand Mazeland [Tue, 8 Oct 2013 16:08:00 +0000 (18:08 +0200)]
Remove unused local variable

Change-Id: I93ce25fe158f7a82ade102953d6a2453620b7e0e

10 years agoMerge "tests: remove date from @author docs statements"
jenkins-bot [Wed, 9 Oct 2013 15:38:53 +0000 (15:38 +0000)]
Merge "tests: remove date from @author docs statements"

10 years agoMerge "Make items in the StringUtilsTest data provider easier to identify by adding...
jenkins-bot [Wed, 9 Oct 2013 15:34:21 +0000 (15:34 +0000)]
Merge "Make items in the StringUtilsTest data provider easier to identify by adding names."

10 years agoMerge "Fix PHP CodeSniffer errors and warnings"
jenkins-bot [Wed, 9 Oct 2013 15:17:59 +0000 (15:17 +0000)]
Merge "Fix PHP CodeSniffer errors and warnings"

10 years agoMake items in the StringUtilsTest data provider easier to identify by adding names.
Jan Zerebecki [Thu, 23 May 2013 09:37:32 +0000 (11:37 +0200)]
Make items in the StringUtilsTest data provider easier to identify by adding names.

Change-Id: I026eff69236187ce3d2ff2fc261a5e1d9cd88b24

10 years agoUpdate formatting
Siebrand Mazeland [Tue, 8 Oct 2013 11:43:42 +0000 (13:43 +0200)]
Update formatting

With some manual corrections.

Change-Id: Icd947288c32fdb90a0f35388963ef5a17ffa58e7

10 years agoFormatJson: minor cleanup
Kevin Israel [Tue, 8 Oct 2013 14:52:01 +0000 (10:52 -0400)]
FormatJson: minor cleanup

* Prefer feature detection over version comparison.
* Prefer pre- over post- increment and decrement operators.
* Remove the statement that FormatJson::decode() decodes `true`,
  `false`, and `null` case insensitively. Nobody should assume
  this is (or is not) the case, even though the PHP manual says so.
* Avoid using the ternary operator with long strings; prior to
  PHP 5.4, the operator prevented the copy-on-write optimization.
* Avoid placing comments on the same lines as code.

Change-Id: I8fc88e9b7b49aa0cbd4128216557836a3b2cd011

10 years agoAdd some siteinfo to the repo info array
Mark Holmquist [Tue, 8 Oct 2013 07:01:54 +0000 (00:01 -0700)]
Add some siteinfo to the repo info array

Used for linking to user pages on remote repos in the
MultimediaViewer extension.

Change-Id: Ia703d63e8e02b1e8fbc90b7d7f90a748d9e177ec

10 years agoQuick refactor of the http logic in ForeignAPIRepo
Mark Holmquist [Tue, 8 Oct 2013 20:11:54 +0000 (13:11 -0700)]
Quick refactor of the http logic in ForeignAPIRepo

Automatic caching, will enable slightly smaller patches elsewhere.

Resetting after failing at a rebase.

Change-Id: I6849107a3af773687a31155b23a2d7b4d7a60645

10 years agoMerge "Fix revision table cleanup on delete"
jenkins-bot [Tue, 8 Oct 2013 20:36:45 +0000 (20:36 +0000)]
Merge "Fix revision table cleanup on delete"

10 years agoAdd script to purge changed files from cache
Bryan Davis [Fri, 4 Oct 2013 22:38:09 +0000 (16:38 -0600)]
Add script to purge changed files from cache

This maintenance script enhances the prior purgeDeletedFiles script to
optionally also process create and modify events that may have left
stale information in front-end caches.

Changes from purgeDeletedFiles:
* `--starttime` & `--endtime` are now required
* `--type` allows selecting 'created' and/or 'modified' events in
    addition to 'deleted' events.
* `--dry-run` to list affected files but perform no purges
* `--htcp-dest` option to restrict HTCP broadcast messages

Change-Id: I7181ea461ba9758747bff4fd70530d00dab492cc

10 years agomediawiki.action.edit.preview: Fix for LiquidThreads hack
Timo Tijhof [Tue, 8 Oct 2013 19:40:00 +0000 (21:40 +0200)]
mediawiki.action.edit.preview: Fix for LiquidThreads hack

LiquidThreads is loading this core module when rendering an
inline edit form. Because the form doesn't have the same ID
as the one in core, this broke after becd284.

It previously worked because the click event on the button (of
which LQT did duplicate the ID from core) bubbles up to the
document body and thus trigger this private handler of the
core edit preview module.

Change-Id: I9e35d0c48b86e1c9073b68313a8a330c6ea85b86

10 years agoMerge "Localisation updates from http://translatewiki.net."
Translation updater bot [Tue, 8 Oct 2013 19:18:47 +0000 (19:18 +0000)]
Merge "Localisation updates from translatewiki.net."

10 years agoMerge "Add file-link "parser" to mw.Title from commons"
jenkins-bot [Tue, 8 Oct 2013 19:09:15 +0000 (19:09 +0000)]
Merge "Add file-link "parser" to mw.Title from commons"

10 years agoLocalisation updates from http://translatewiki.net.
Translation updater bot [Tue, 8 Oct 2013 19:00:46 +0000 (19:00 +0000)]
Localisation updates from translatewiki.net.

Change-Id: I331db0fe25638bdab35fbf54d00dd77f93488a7a

10 years agoAdd file-link "parser" to mw.Title from commons
Mark Holmquist [Fri, 4 Oct 2013 00:06:53 +0000 (17:06 -0700)]
Add file-link "parser" to mw.Title from commons

Rillke has been amazing and provided us with a first pass at a file URL
parser for MediaWiki:

https://commons.wikimedia.org/wiki/MediaWiki:Gadget-libUtil.js

Hoping to use this for Extension:MultimediaViewer and others in the near
future - potentially replacing patchset Ib69d1ffdfd3b58c2e8e3314940a2cad311b85533

Also tests.

Change-Id: Ie31e6df376bda087e92ec889d54df3374ba96b5e

10 years agoMerge "Allow $context->setTitle( null )"
jenkins-bot [Tue, 8 Oct 2013 18:30:02 +0000 (18:30 +0000)]
Merge "Allow $context->setTitle( null )"

10 years agoAdd doc comment to Status explaining use
Bryan Davis [Tue, 8 Oct 2013 17:51:32 +0000 (11:51 -0600)]
Add doc comment to Status explaining use

Tim posted a nice explanation of the recommended pattern for using the
Status object to wikitech-l. This change copies that explanation into
the phpdoc comment block of the Status class in an attempt to propagate
the meme.

Change-Id: Ia98543caaa829cad443abf0f0f5038b3de943ef8

10 years agoFix PHP CodeSniffer errors and warnings
Siebrand Mazeland [Tue, 8 Oct 2013 17:32:04 +0000 (19:32 +0200)]
Fix PHP CodeSniffer errors and warnings

Change-Id: I573d73b4cf1dcddfe14e9d565e4f170ad024ea31

10 years agoMerge "Fixup parameter type hints"
jenkins-bot [Tue, 8 Oct 2013 17:31:22 +0000 (17:31 +0000)]
Merge "Fixup parameter type hints"

10 years agoMerge "Add method parameter type documentation"
jenkins-bot [Tue, 8 Oct 2013 17:08:15 +0000 (17:08 +0000)]
Merge "Add method parameter type documentation"

10 years agoMerge "Move forceHTTPS check until after wgTitle is setup"
jenkins-bot [Tue, 8 Oct 2013 16:34:13 +0000 (16:34 +0000)]
Merge "Move forceHTTPS check until after wgTitle is setup"

10 years agoAdded $wgExtensionEntryPointListFiles for use with mergeMessageFileList.php
Reedy [Wed, 18 Sep 2013 23:00:47 +0000 (00:00 +0100)]
Added $wgExtensionEntryPointListFiles for use with mergeMessageFileList.php

Going to be used to change target file for labs vs production

Change-Id: Id4b16083435ef7f4fce31861c72889e664d07236

10 years agoAdd list=allfileusages
umherirrender [Thu, 2 May 2013 15:28:33 +0000 (17:28 +0200)]
Add list=allfileusages

This allows the client to enumerate through entries of the imagelinks
table.

This can be useful to find images from foreign repos used on the own
wiki.

Change-Id: I2ad0579e3521868d39f7d495ea9c83a2cd9731d6

10 years agoFix help string to avoid PHP notice
S Page [Tue, 8 Oct 2013 04:13:19 +0000 (21:13 -0700)]
Fix help string to avoid PHP notice

Escape a $ symbol in help message and rephrase slightly.  Without this,
`php maintenance/language/checkDupeMessages.php --help` prints
PHP Notice:  Undefined variable: dupeMessages in
        language/checkDupeMessages.php on line 56

Change-Id: Ie7c0f07e68cee1f7cd2758f71b09d34e339d4b7b

10 years agoMade root job de-duplication work without cache setup
Aaron Schulz [Tue, 8 Oct 2013 02:30:10 +0000 (19:30 -0700)]
Made root job de-duplication work without cache setup

bug: 55454
Change-Id: I9fbc1e34b4b771a16e567a1a16e2720af4379188

10 years agoMerge "Localisation updates from http://translatewiki.net."
Translation updater bot [Tue, 8 Oct 2013 00:59:50 +0000 (00:59 +0000)]
Merge "Localisation updates from translatewiki.net."