Removed usage of global objects in SpecialEmailUser

* Added $context parameter to SpecialEmailUser::submit() to replace usage of $wgUser and wfMsg*() calls; added SpecialEmailUser::uiSubmit() as wrapper for HTMLForm submission and updated the call in ApiEmailUser
* Use local context to get messages

Change-Id: Id5a7330486b9ccd5325293590eeefeba1c0f0536
(bug 34956) Parser should use mUrlProtocol instead of wfUrlProtocols()

Change-Id: I069f21f86bbca55cf05f9a44b2ff3ea960c8af12
(bug 33602) list=allusers throws exceptions with invalid names

Some MediaWiki installations have invalid user names in user table
(most notable example: en.wikipedia). This commit DOES NOT resolve
the issue completely, it only makes the API behave more gracefully.

I have replaced User::newFromName call with User::newFromId, so the
User object should be always constructed. In case it was not, an
empty array will be provided instead of null when returning user
rights. I have removed keyToTitle calls for ContinueEnumParameter
as user names in the database are stored without underscores
(en.wikipedia has of course one user with _ in the database...).
This should fix invalidtitle error thrown.

There is one issue I don't know how to solve. When API outputs in
query-continue aufrom value with invalid user name, subsequent
call with aufrom set will return an error, because input parameters
'from' and 'to' are passed to keyToTitle method too. Should I
replace it with simple str_replace('_', ' ')?

Change-Id: I7d115e734cb8c93dcf6dc3b98bdbc81975951273
fwriting to STDOUT -> print in Maintenance

Change-Id: I50dec90893a5dc88a5deabcc05a8c32058aca4c8
Adding Maintenance output tests

Change-Id: Ib2cb36cd840505e2956a6b0978cea1920277d42c
36019: Revert b/25095 breaks Special:Categories

bug 25095: Special:Categories doesn't show first relevant item when "from" is filled"
bug 36019: Special:Categories does not keep "from" parameter between list size changes

This reverts commit 1a5edfa6c0584e2cdc8310f302962fd8daea31eb.

This commit broke behaviour of CategoryPager inherited
fromAlphabeticPager.

This was actually pointed out:

* https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113415#c32002

This needs to go into 1.19 as well.

Conflicts:

	RELEASE-NOTES-1.19

Change-Id: I119160d59c4fca0d069adef60151b30d53b582a1
Refactoring previewnote.

This is a followup to https://gerrit.wikimedia.org/r/#change,3978 .

Splitting the message previewnote to two messages: one is the note
itself, as it was before change 3978, and the other is the link text.

This change relieves the translators from the need to type wiki code
in the translated message and to wonder whether they should translate
"editform" or not.

Change-Id: I50aaf6dd48aaeee86cacf5c8fc06594869b38fd9
let us easily override PHPUnit version

The new --with-phpunitdir let us specify a git checkout of PHPUnit. That
will ease regression testing of the upstream new version. Usage is
straightforward:

Checkout PHPUnit from git as instructed on:
https://github.com/sebastianbergmann/phpunit#readme

Invoke our test suite with:
 $ cd maintenance/tests
 $ php phpunit.php --with-phpunitdir /path/you/just/checked/out

Change-Id: I8a9af0deac4dd74e3c8bde73535555c54ac83766
Optimise WikiPage::newFromID() to load all the data in one database query.

* Separated the last part of WikiPage::loadPageData() into loadFromRow() to put database access and object loading into separate methods (and also for consistency with other classes)
* Added WikiPage::newFromRow() to be able to get a WikiPage object from an already-existing database row
* Modified WikiPage::newFromID() to do a single database request to get all the necessary data and make it use the new newFromRow() method

Change-Id: I2db423f2dba10cc3db4f4b2e7a7b9d99cd114f33
(bug 36047) Adds high definition (HD) CSS for the Vector skin

This patch adds a high definition (HD) style sheet for vector which adjusts
various margin and padding properties to give the page a less crammed-
together feel. All properties transition over 250ms and only activated if
the browser is 900px wide or greater. This size should work well for 1024px
wide screens sans scroll bar, window borders, space around browser, etc.

Change-Id: I85fc70e324b3b93c943efcc827eefdfb3bda7fdf
bug 36087: PostgresUpdater fails on 8.3.14

PostgresUpdater fails on PostgreSQL 8.3.14:

> Changing 'image.img_metadata' default value
> A database query syntax error has occurred.
> The last attempted database query was:
> "ALTER TABLE image ALTER img_metadata SET DEFAULT '\x'::bytea"
> from within function "".
> Database returned error "22P02: ERROR:  invalid input syntax for type
> bytea"

Patchset 2:

> Database returned error "42883: ERROR:  function
> generate_subscripts(int2vector, integer) does not exist
> LINE 7:     (SELECT generate_subscripts(isub.indkey, 1) AS g
>                     ^
> HINT:  No function matches the given name and argument types. You
> might need to add explicit type casts.
> "

Change-Id: I6e1811ded0eedad9c0eb0df715698c45aaf8e3f0
Destroy any lock manager connections when forking.

Change-Id: I320ac659559eb82378da0b9afbbb1dd3e48ba41c
strip off subpages direct in GenderCache

LinkBatch can also give subpages to the GenderCache and therefor it is
easier to do it always in GenderCache, than in LinkBatch and Title

Add unit tests for GenderCache

Change-Id: Ia936ff8bb639a197b0b3a8e07c97a66edd57dd10
[FileBackend] Added some basic directory functions.

* Added directoryExists() function to check if a dir exists.
* Added getDirectoryList() and getTopDirectoryList() functions to list out subdirs.
* Added getTopFileList() function to list out immediate files in a dir. This wraps getFileList(), which was modified.

Change-Id: I087835f40d76c41f5d6af55b9a34a51e0f44a675
Fix notices from r94259 due to undefined variables

Fix notices from r94259 due to undefined variables
$previewtext and $class in the isWikitextPage()==true case.

Change-Id: I6ae2486d8860d2c28d656cdbd594ebc3a1263537
Merge "Destroy any lock manager connections when forking."
Merge "Fix notices from r94259 due to undefined variables"
Use $wgContLang and an anonymous user in refreshLinks.php to parse pages.

Normally it should already be correct, but just in case it gets broken for some reason.

Change-Id: Ia38df1ba1f4a6224296bfd837a515ce0ccdf55cb
Merge "bug 36087: PostgresUpdater fails on 8.3.14"
Fix magic $ aliasing in ResourceLoader

This was removed in 5bf04171dc34521f7ee7e33ba17a90c7a772ab31 , but broke
Twinkle on enwiki just now.

Change-Id: I1b131e26181b3b8b6cd68a1b965b9ab9ba1299af