Commit graph

302 commits

Author SHA1 Message Date
Kevin Israel
aedc6c23ea Run generateLocalAutoload.php
Change-Id: I618f831f5c33d0163b873dd0494cc37799450001
2016-04-07 11:36:03 -04:00
jenkins-bot
de94dd9f41 Merge "Revert "Split ClassCollector class into own file"" 2016-04-07 15:11:14 +00:00
Max Semenik
943563062f Kill mbstring fallbacks
In the age when we require PHP 5.5, pretending that mbstring emulation
is not slow and silly is silly.

Bug: T129435
Change-Id: Ic8235c9da9a926df63ec7388900c44eab454eebe
2016-04-06 22:14:48 +00:00
PleaseStand
bb16bb4c7d Revert "Split ClassCollector class into own file"
The AutoloadGenerator class is instantiated in the script
maintenance/generateLocalAutoload.php and its equivalents in
several extensions, none of which use MediaWiki's AutoLoader,
so you get a "Fatal error: Class 'ClassCollector' not found".

This reverts commit a379bebd03.

Change-Id: Ia6a7a1cb8a593ac86ecffdb690064e0b8ad68b47
2016-04-04 03:26:24 +00:00
jenkins-bot
57e546df19 Merge "Split ClassCollector class into own file" 2016-04-03 10:52:49 +00:00
jenkins-bot
28b80e55c2 Merge "Move CookieJar class to own file" 2016-04-03 10:52:45 +00:00
jenkins-bot
cec83f8afa Merge "Move EventRelayerNull class to own file" 2016-04-03 09:59:48 +00:00
addshore
d112448663 Move EventRelayerNull class to own file
Change-Id: I5450bda32482b5183e6d2c35e2df5c419155e2de
2016-04-03 11:59:09 +03:00
addshore
7a62e41f09 Move CookieJar class to own file
Change-Id: Ie98eadb2a8015f1290447b79cc095799abaeba4f
2016-04-03 11:46:36 +03:00
addshore
e8c15f0e94 Split Collation.php
Change-Id: I6abfecf91cdce83dd34b1e8aa8e0b35315f62742
2016-04-03 11:23:20 +03:00
addshore
a379bebd03 Split ClassCollector class into own file
Change-Id: I61210d1e963e0cd1278debff8f6826c5c79a88e9
2016-04-03 11:16:42 +03:00
jenkins-bot
9ee6461287 Merge "Introduce top level service locator." 2016-04-03 07:26:31 +00:00
daniel
eb46307b00 Introduce top level service locator.
The service locator, MediaWikiServices, is intended to facilitate
"manual" dependency injection in static entry points.

See also the Dependency Injection RFC T384 and Service Locator
RFC T124792 for details.
The following key points were implemented according the
discussion surrounding these RFCs:

* a configurable DI container that allows extensions to add and replace services.
* no auto-wiring, since it's prone to add confusion in large and complex applications.
* no 3rd party framework, since they typically do too much.

The following services in MediaWiki core are made accessible via the service locator
mechanism to showcase the bootstrapping mechanism:

* ConfigFactory and MainConfig
* SiteLookup and SiteStore

However, the implementation of these services was not yet converted to using proper DI
throughout the code.

Bug: T124792
Change-Id: I3c25c0ac17300d3dd13e1cf5100558a605eee15f
2016-04-02 18:07:28 +03:00
jenkins-bot
b9875c0543 Merge "Split Page interface into own file" 2016-04-02 13:52:04 +00:00
addshore
43391b8300 Split Page interface into own file
Change-Id: Ib2e23f63e47a3da19e30f4a8d61372ee0f26851d
2016-04-02 16:35:20 +03:00
addshore
d047a9c604 Introduce StatsdAwareInterface
Change-Id: Iac343e4b448d9af852b4c479c35a9ff60359b6d5
2016-04-02 13:29:51 +00:00
addshore
737e83edf5 Move statsd files in libs to own directory
Change-Id: Ia3ac9441d7548fedb672e3f2567be7c4eafae208
2016-04-02 13:15:15 +00:00
addshore
6ae77e6984 Introduce NullStatsdDataFactory
I have left the phpdocs in NullStatsdDataFactory
to clearly show the return types of the interface
implemented.

Change-Id: I96cb64b4af16fc087028269a53d539f8c132f81c
2016-04-02 13:02:37 +00:00
jenkins-bot
098ad31589 Merge "Split Pager classes out of SpecialPage files" 2016-03-28 02:27:13 +00:00
addshore
f51b1cd9ec Split Pager classes out of SpecialPage files
Change-Id: I6c8dbc9084040dd3b8a5e19caaf076bd14b77762
2016-03-24 11:39:38 +00:00
addshore
b8ca311a1c Split LocalisationCache.php classes into own files
Change-Id: I1b88081e6b082fcad73990550a3ffbf58e11d97e
2016-03-24 11:00:44 +00:00
Florian
18c6615d01 MediaWiki Widgets: Add new SearchInputWidget
SearchInputWidget is similar to a TitleInputWidget, but doesn't has
a visible loading indication, doesn't highlight the first result and
uses the opensearch api endpoint for suggestions, instead of
prefixsearch.

Extra points:
 * Improve documentation of mw.widgets.TitleInputWidget's configuration
   option validateTitle

Bug: T118443
Change-Id: I8b8098041fe2971389fa908d007d2e77255829ec
2016-03-03 16:29:40 +00:00
addshore
26cd337c2e Move MagicWordArray class to own file
Change-Id: I9ba602da77f1c8d4270d8ae10d03e82a3197e5b1
2016-03-01 10:49:29 +00:00
jenkins-bot
f26ac509db Merge "Move WatchedItem::duplicateEntries to WatchedItemStore" 2016-02-25 16:44:04 +00:00
Luke Faraone
460ea2524c Add toggle checkboxes to action=history
This breaks out the toggle checkbox code into a separate class in
includes/ListToggle.php

Bug: T92230
Change-Id: I8d1aefb83008053e63d59abf8b8915b93e15fcc2
2016-02-21 20:34:42 +00:00
umherirrender
f800abc858 Use short array for generator output
The AutoloadGenerator and LocalSettingsGenerator should generate short
array syntax

Change-Id: I5772640556fd6274db0d522341a98c0acfe5794d
2016-02-17 22:08:07 +01:00
addshore
54d4315be6 Move WatchedItem::duplicateEntries to WatchedItemStore
This removes static logic from WatchedItem into a
class that we can slowly fill with watchlist database
and storage things.

This also removes the dual namespace handling in
the new implementation.

Change-Id: Ia67ab1d200ac393c65013b2091e61acefcb3defb
2016-02-17 15:22:32 +00:00
Bryan Davis
db47c86bc5 Update AutoLoaderTest and ran maintenance/generateLocalAutoload.php
AutoLoaderTest didn't know about traits.

generateLocalAutoload found a  missing Trait from the autoloader and
a class map ordering issue.

Change-Id: I34bf2698ad838b6a977c9bf39f6e416330ff0e5d
2016-02-12 13:12:20 +00:00
Bryan Davis
9750adacdd SessionProvider::mergeMetadata: Log additional data
Add the data values and types to the exception raised when mismatched
session data is processed. This is done by passing the old and new
values on via a new MetadataMergeException class. The attached data is
added to the debug logging context info when caught.

Change-Id: If8a7174399289bc284ca1b36052ba515c8857c50
2016-02-11 14:21:14 -07:00
Tim Starling
6a269d4d8d Suppress SessionManager sessions in the installer
SessionManager cannot work in the installer since it depends on
ObjectCache which is just an EmptyBagOStuff and so doesn't store
anything. So, introduce a custom SessionProvider which pretends to
persist sessions but actually doesn't.

Bug: T126177
Change-Id: I13d8aa1453c519df7c19ca2f1fb052c99ade043c
2016-02-11 10:48:28 +11:00
Aaron Schulz
621487f603 Make CDN purges send EventRelayer events
* Also create EventRelayerGroup class and config

Bug: T97562
Change-Id: Id7c9b0deb0ffd21277572a8e6407f87be6931a4d
2016-02-09 14:13:21 -08:00
Geoffrey Mon
e74f36ebe0 Implement action=mergehistory
* New class ApiMergeHistory handles action=mergehistory
* Merge History functionality moved from SpecialMergeHistory to
  MergeHistory
* SpecialMergeHistory now uses MergeHistory for actual merging
* Unit tests and i18n messages for above

Bug: T69742
Change-Id: Ic5078307dae78a2b3687e34a5d0a584988d483a1
2016-02-06 10:39:27 -05:00
jenkins-bot
69cc66efeb Merge "Split ImagePage.php into separate classes" 2016-02-04 11:48:37 +00:00
Thomas Arrow
2c2d6248f9 Split ImagePage.php into separate classes
Change-Id: Id2ca94c50b75d24da4d02fe82747a7ce7edccd9f
2016-02-04 12:26:36 +01:00
jenkins-bot
ff20437da7 Merge "Include completion search into SearchEngine" 2016-02-04 02:09:46 +00:00
Stanislav Malyshev
027972a20f Include completion search into SearchEngine
By default it still uses PrefixSearch and supports PrefixSearchBackend
but it can be deprecated and phased out and SearchEngine extensions used
instead.

New APIs:
- SearchEngine
	public function defaultPrefixSearch( $search );
	public function completionSearch( $search );
	public function completionSearchWithVariants( $search );

Search engines should override:
protected function completionSearchBackend( $search );

Bug: T121430
Change-Id: Ie78649591dff94d21b72fad8e4e5eab010a461df
2016-02-03 23:41:49 +00:00
Brad Jorsch
25dbd91513 Clean up after Ie161e0f
Ie161e0f was done in a hurry, and so didn't do things in the best ways.
This introduces a new "CachedBagOStuff" that transparently handles all
the logic that had been copy-pasted all over in Ie161e0f.

The differences between CachedBagOStuff and MultiWriteBagOStuff are:
* CachedBagOStuff supports only one "backend".
* There's a flag for writes to only go to the in-memory cache.
* The in-memory cache is always updated.
* Locks go to the backend cache (with MultiWriteBagOStuff, it would wind
  up going to the HashBagOStuff used for the in-memory cache).

Change-Id: Iea494729bd2e8c6c5ab8facf4c241232e31e8215
2016-02-03 21:45:18 +00:00
Brad Jorsch
2257fe4228 Revert "Remove SessionManager, temporarily"
This reverts commit 823db5d63dd5200d04c63da50ba6bf16f928e70b.

Change-Id: Ibb3e023e4eb6715295586dea87d0725c344a8271
2016-02-03 21:44:59 +00:00
Brad Jorsch
f0207e8ca6 Add Special:ApiSandbox
Like Extension:ApiSandbox, but rewritten to use OOJS-UI and to add many
long-requested features.

Bug: T89386
Bug: T92893
Bug: T98457
Bug: T98083
Bug: T89229
Bug: T66008
Bug: T50607
Bug: T47811
Bug: T38875
Bug: T36962
Bug: T34740
Change-Id: Ic42a6c5ef54b811cd63cfef2132942b27a626fe5
Depends-On: I85c0eedcd31a0e419d8055eca0d9cb1ba872ae62
Depends-On: Ic85ff4abbbcd2076ebf5cdfaa0e95e98878e2308
2016-02-03 11:13:59 -05:00
jenkins-bot
9a3a412f86 Merge "Add LinkTarget interface" 2016-02-03 13:23:08 +00:00
Brad Jorsch
5083e810eb Remove SessionManager, temporarily
The plan here is to take it out of 1.27.0-wmf.12 and put it back in
1.27.0-wmf.13.

Since BotPasswords depends on SessionManager, that's getting temporarily
removed too.

This reverts the following commits:
* 6acd424e0d SessionManager: Notify AuthPlugin before calling hooks
* 4d1ad32d8a Close a loophole in CookieSessionProvider
* fcdd643a46 SessionManager: Don't save non-persisted sessions to backend storage
* 058aec4c76 MessageCache: Don't get a ParserOptions for $wgUser before the end of Setup.php
* b5c0c03bb7 SessionManager: Save user name to metadata even if the user doesn't exist locally
* 13f2f09a19 SECURITY: Fix User::setToken() call on User::newSystemUser
* 305bc75b27 SessionManager: Don't generate user tokens when checking the tokens
* 7c4bd85d21 RequestContext::exportSession() should only export persisted session IDs
* 296ccfd4a9 SessionManager: Save 'persisted' flag in session metadata
* 94ba53f677 Move CSRF token handling into MediaWiki\Session\Session
* 46a565d6b0 Avoid false "added in both Session and $_SESSION" when value is null
* c00d0b5d94 Log backtrace for "User::loadFromSession called before the end of Setup.php"
* 4eeff5b559 Use $wgSecureCookie to decide whether to actually mark secure cookies as 'secure'
* 7491b52f70 Call session_cache_limiter() before starting a session
* 2c34aeea72 SessionManager: Abstract forceHTTPS cookie setting
* 9aa53627a5 Ignore auth cookies with value 'deleted'
* 43f904b51a SessionManager: Kill getPersistedSessionId()
* 50c5256352 SessionManager: Add SessionBackend::setProviderMetadata()
* f640d40315 SessionManager: Notify AuthPlugin when auto-creating accounts
* 70b05d1ac1 Add checks of $wgEnableBotPasswords in more places
* bfed32eb78 Do not raise a PHP warning when session write fails
* 722a7331ad Only check LoggedOut timestamp on the user loaded from session
* 4f5057b84b SessionManager: Change behavior of getSessionById()
* 66e82e614e Fix typo in [[MediaWiki:Botpasswords-editexisting/en]]
* f9fd9516d9 Add "bot passwords"
* d7716f1df0 Add missing argument for wfDebugLog
* a73c5b7395 Add SessionManager

Change-Id: I2389a8133e25ab929e9f27f41fa9a05df8147a50
2016-02-01 22:06:49 +00:00
jenkins-bot
e57998f533 Merge "Use autoloader for PHP data files instead of include/require" 2016-02-01 15:11:54 +00:00
Florian
2f5dd32e9d Add missing ResetUserEmail class to autoload.php
The test in I3a426b92892f4c00cab33a13f6a717751120367c would prevent
the need of this commit :P

Follow up: I2b875326a0eb1e6d1f4bc758b8ac97b8f9324c4e

Change-Id: Id5efc5a5b43a1795c133f64025ea04f3e2d159cb
2016-01-31 09:09:35 +00:00
Tim Starling
f43e0d840f Use autoloader for PHP data files instead of include/require
Move ZhConversion.php and Names.php to languages/data and make them both
expose their data as static class variables instead of in the local
scope. This means that the autoloader can be used to load the data,
which is efficient and secure. This also makes additional request-local
caching of the arrays unnecessary.

Change-Id: Iafb96ac4165d0965fcb9a69f1d0a91139ea9790c
2016-01-30 13:08:46 +11:00
addshore
1c63abcda3 Add LinkTarget interface
To be used by things that do not care if they are
passed a Title or TitleValue so long as it has a
dbkey, namespace, possible fragment and text

Example uses include:
 LinkBatch::addObj
 MediaWikiPageLinkRenderer methods
 MediaWikiTitleCodec methods
 PageLinkRenderer methods
 TitleFormatter methods

Change-Id: I2aa1a82129bb01155924a8e6a403c7a47391432f
2016-01-29 12:48:21 +01:00
Brad Jorsch
94ba53f677 Move CSRF token handling into MediaWiki\Session\Session
User keeps most of its token-related methods because anon edit tokens
are special. Login and createaccount tokens are completely moved.

Change-Id: I524218fab7e2d78fd24482ad364428e98dc48bdf
2016-01-27 15:27:20 -05:00
Florian
6af638754d Fix autoload.php order
Someone maybe added it by hand :) It will add some noise to
other changes, where autoload.php is genereted with
maintenance/generateLocalAutoload.php

Change-Id: If064fcc1fe87165df72eaf368117e62a51b24e95
2016-01-27 17:15:36 +00:00
Bartosz Dziewoński
1ebc9128d0 Remove putrid remains of $wgAllowAsyncCopyUploads
None of this works and it's been long begging for a mercy kill.
All it does is waste contributor time on updating deprecations
in the dead code. I imagine we wouldn't reuse much of this
code if we're ever going to reimplement it.

Bug: T119336
Change-Id: Ibd26a4bea621857aac77823017e9be9b7dc52cca
2016-01-22 00:18:25 +00:00
jenkins-bot
a7f35b7859 Merge "Deprecate wfWaitForSlaves() with LBFactory::waitForReplication()" 2016-01-20 00:10:39 +00:00
Tim Hollmann
6479706b97 Add Special:Randomrootpage (from RandomRootPage extension)
Imported RandomRootPage extension as SpecialRandomrootpage, including
its aliases and localization messages.

Bug: T109809
Change-Id: I7252ae9f4a8f1822b023cc4f0d3a732af48d84d3
2016-01-18 14:12:32 -08:00