Commit graph

391 commits

Author SHA1 Message Date
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
jenkins-bot
b3a82cadfb Merge "API to fetch data about stashed images" 2016-01-15 17:02:02 +00:00
Cindy Cicalese
e48030a7ae Add page_props table access class
Bug:T115331
Change-Id: I022b9e3ca47dc63650b8a62260603b0893a80e69
2016-01-15 03:51:57 +00:00
Aaron Schulz
ec63f72c79 Add AtomicSectionUpdate deferred update class
This makes it easier to have deferred atomic DB transactions

Bug: T122115
Change-Id: I67afe335f03cc21fdce78abdf3f31fa67a368419
2016-01-14 10:32:39 +00:00
Aaron Schulz
3592f8cea3 Add simple JobQueueMemory class for testing
Change-Id: I1acce43dbab3b12393d6dc4675850695c619d88a
2016-01-14 00:23:05 +00:00
Brad Jorsch
f9fd9516d9 Add "bot passwords"
Bot passwords are something like OAuth-lite, or Google's application
passwords: the bot can use API action=login to log in with the special
username and password, and will then be allowed to use the API with a
restricted set of rights.

This is intended to provide an easy migration path for legacy bots and
for bots on wikis without OAuth, since AuthManager is going to greatly
complicate non-interactive authentication. If OAuth is available, an
owner-only consumer would be a better choice.

Bug: T121113
Change-Id: Iaa4015e00edbfbfaedcc8b2d27a2d3fd25009159
Depends-On: I7e15331efb162275c4116bcae61f19d6b884cbe3
2016-01-12 22:37:44 +00:00
Brad Jorsch
ef5bd7347b Move grant and IP restriction logic from OAuth to core
This also adds code to User to allow SessionProviders to apply the grant
restrictions without needing to hook UserGetRights.

Change-Id: Ida2b686157aab7c8240d6a7a5a5046374ef86d52
2016-01-12 22:37:33 +00:00
Brad Jorsch
a73c5b7395 Add SessionManager
SessionManager is a general-purpose session management framework, rather
than the cookie-based sessions that PHP wants to provide us.

While fallback is provided for using $_SESSION and other PHP session
management functions, they should be avoided in favor of using
SessionManager directly.

For proof-of-concept extensions, see OAuth change Ib40b221 and
CentralAuth change I27ccabdb.

Bug: T111296
Change-Id: Ic1ffea74f3ccc8f93c8a23b795ecab6f06abca72
2016-01-12 21:57:01 +00:00
Mark Holmquist
0f9c0b286f API to fetch data about stashed images
Only works for the currently logged-in user (I'm not sure how that works
with bots, if OAuth will do that correctly or whatever) but will help us
do some neat stuff with tools that use the stash - including resuming
uploads.

Bug: T85561
Change-Id: I215ac6936185563f4c7b42a4bced65e4b096fd15
2016-01-12 14:57:46 -06:00
Andrew H
c812fa3cb3 Add maintenance script importTextFiles.php
importTextFiles.php can be used to import pages from text files
containing wikitext.

Also, added $userObj to WikiRevision so that it can accept a User
object instead of just a username.

This is a GCI task.

Change-Id: I20eaf2005bdd3d041f55d8c0b108f001c064d638
2016-01-08 00:57:11 +00:00
Tim Hollmann
6d55397e7c Split the classes in WebInstallerPage.php into multiple files
Bug: T122634
Change-Id: If6606a0e1c2a5ec5651cc7f83cf7342ff8c6c765
2016-01-07 19:03:30 +00:00
Chad Horohoe
bec95ed857 Remove WaitForSlave maintenance script
Maxlag param for wfWaitForSlaves has been deprecated.

Change-Id: I61c09266848e248a28510e267e73ff7177d51bc0
2016-01-05 14:21:18 -08:00
jenkins-bot
79cc4f54e2 Merge "Factor page name normalization out of MediaWikiSite" 2016-01-05 01:39:28 +00:00
Marius Hoch
4c574daa45 Factor page name normalization out of MediaWikiSite
Into a new MediaWikiPageNameNormalizer.

The code has been copied over almost 1:1, I only
left the phpunit test special handling in MediaWiki site.

Change-Id: I008cadd29a2aa1f21098339b895c35a100959b04
2016-01-04 17:32:22 -08:00
Justin Du
f8450b63cb Split WebRequest.php classes
Change autoload.php file to accomodate the split

Bug: T122633
Change-Id: I0b2260da7cc086659fdd0894f7bb94798dff1163
2016-01-04 21:34:25 +00:00
ananay
959042921f Split PHP classes from SpecialConfirmemail.php into separate files
Bug: T122636
Change-Id: Icfdb306e0df8e3571571413d4a340235cd70f1e3
2016-01-04 20:17:15 +00:00
Justin Du
3b0f55c492 Split SearchResultSet.php classes
Change autoload.php file to accomodate the split

Bug: T122637
Change-Id: I3a326aa329c3be64662825ac06b169ae96b8f53c
2016-01-03 17:12:10 -06:00
This, that and the other
4abb459392 Refactor dumpBackup.php and dumpTextPass.php to be Maintenance subclasses
Use the Maintenance class's new $orderedOptions and support for
passing options multiple times. This allows for option "chaining".

The BackupDumper and TextPassDumper class now extend Maintenance, but
should continue to function as before. The public function processArgs()
has been removed and replaced by processOptions(), which takes no
parameters. It is unlikely that users of these classes were calling
processArgs.

Inheritors of these classes that overrode processOption() will now need to
override processOptions() and use Maintenance::getOption() and friends.

The maintenance/backupTextPass.inc file has been deleted. Users should
include maintenance/dumpTextPass.php instead.

Bug: T122587
Change-Id: I2473ee119c185d1b2b00ac4b1e70ee8a6cafe4a3
2015-12-31 20:46:54 +11:00
jenkins-bot
6a32534646 Merge "Split classes in Import.php into separate files" 2015-12-30 00:16:39 +00:00
jenkins-bot
e53676d3dd Merge "Show user names as subpages of special pages in autocomplete search" 2015-12-30 00:16:20 +00:00
umherirrender
3e0f3cfd43 Show user names as subpages of special pages in autocomplete search
The autocomplete search allows special pages to define the list of
subpages to be excepted. Use user names on the following special pages,
because these special pages can be called with a user name as subpage.

Special:Block
Special:Contributions
Special:DeletedContributions
Special:Emailuser
Special:Listfiles
Special:Unblock
Special:Userrights

This makes it easier to navigate to this special pages with a prefilled
user name field.

Hidden user names are always not shown, because the suggestion is cached
between priviliged user and non-priviliged user.

Change-Id: I7db575bf66caaa5136489ed99f1655673b55adaf
2015-12-29 11:49:58 +01:00
Krzysztof Zbudniewek
cdeba4cfc7 Split classes in Import.php into separate files
Bug: T122532
Change-Id: Ic4463ab8d3a7b2779f43efb92cb790dbc1d88064
2015-12-29 00:42:33 +01:00
mhutti1
c92aa31aab Split Export.php classes into seperate files
Moved classes in Export.php to seperate files in the new directory
includes/export/ and updated autoload.php to these new locations.

Bug: T122531
Change-Id: Idd3bba5a85d65c952f2ff503bea2ca76624c9b7f
2015-12-28 22:51:06 +00:00
Aaron Schulz
fedfee628c Deprecate wfWaitForSlaves() with LBFactory::waitForReplication()
This has a cleaner interface and makes failure more explicit

Change-Id: I5480845196383df85ba7538e15e507fa1b64948a
2015-12-22 21:05:44 -08:00
aude
0286275cc8 Update autoload.php
with new classes introduced in I9518a52

Change-Id: I971a4a0c4e2cceff67072398960321c1a5dbf549
2015-12-21 23:51:41 +00:00
aude
880e34e0a4 Move ApiQueryGeneratorBase to it's own file
Change-Id: Ia8e9ab256c8a7a72bb407090f7a4a49484e529e4
2015-12-20 14:39:37 +00:00
Bartosz Dziewoński
b65498b9f8 Refresh autoload.php
/me stabs Aaron

Change-Id: I82233877840273ece1c41da73c998fa2bd1b2c99
2015-12-18 23:33:55 +01:00
Aaron Schulz
01c2b0a425 Add $wgCdnReboundPurgeDelay for more consistent CDN purges
Bug: T113192
Change-Id: I89deb4f8143c1cc6154cdd05bcee1f49d3e3a75a
2015-12-10 22:52:30 +00:00
Aaron Schulz
282c5fa9f3 Rename SquidUpdate => CdnCacheUpdate
Squid is not the only possible CDN

Change-Id: Ie2a2955847c5706e630322bbbab71c9d063b378f
2015-12-09 16:31:17 -08:00
jenkins-bot
03320327a5 Merge "Add $wgMaxUserDBWriteDuration to limit user-generated transactions" 2015-12-07 21:25:24 +00:00
jenkins-bot
0c33f44de9 Merge "Remove obsolete showCacheStats.php and showCacheStats.php" 2015-12-07 20:52:28 +00:00
Timo Tijhof
ade945b97a Remove obsolete showCacheStats.php and showCacheStats.php
These scripts interact with keys that used to be set by ParserCache.php.
However this hasn't been the case for a long time now. They use wfIncrStats(),
which is configured by $wgStatsdServer.

Change-Id: Id6a62aec57801085ed684af9362a96eca0914e92
2015-12-07 19:49:29 +00:00
jenkins-bot
7d78861743 Merge "tests: Remove unused TableCleanupTest class" 2015-12-06 22:32:39 +00:00
Ori Livneh
fdca49759b Follow-up for Iba0138a6d: remove now-unused MWHookException class
Change-Id: I9cf80f2b701d6db8a6cfe884e4fd15d4e0482dda
2015-12-04 13:37:18 -08:00
Aaron Schulz
c30b049580 Add $wgMaxUserDBWriteDuration to limit user-generated transactions
This is a low level catch-all net for huge updates that still slip
through. Features that let users add/remove arbitrarily many rows
to lists of arbitrary size can easily result in high lag due to
strange usage patterns or deliberate attacks.

Also removed duplicate 'autochange-username' JSON key.

Bug: T95501
Change-Id: I58a91ca23cae528ef1954d2d78c8f0a90681983e
2015-12-04 13:08:52 -08:00
Aaron Schulz
99610822d8 Add mergeable update support DeferredUpdates
* DeferrableUpdate classes can implement MergeableUpdate.
  Duplicate updates will be merged via the merge() method.
* Make SquidUpdate support merge() so that duplicate URL
  purges are now caught accross the entire pre-send request
  execution.

Change-Id: Idffdd3e71d89e4a0f28281e65a881113caae497c
2015-12-04 19:08:51 +00:00
Aaron Schulz
34dd248e28 Add pre-send update support to DeferredUpdates
* PRESEND/POSTSEND constants can now be used in addUpdate()
  and addCallableUpdate() to control when the update runs.
  This is useful for updates that may report errors the client
  should see or to just get a head start on queued or pubsub
  based updates like CDN purges. The OutputPage::output() method
  can easily take a few 100ms.
* Removed some argument b/c code from doUpdates().
* Also moved DeferrableUpdate to a separate file.

Change-Id: I9831fe890f9f68f9ad8c4f4bba6921a8f29ba666
2015-12-04 19:08:27 +00:00
jenkins-bot
323a2909ba Merge "Extracted some code from PrefixSearch for re-usability by other search engines." 2015-12-04 16:56:39 +00:00
Timo Tijhof
1a8f927d70 tests: Remove unused TableCleanupTest class
Follows-up 77086dc2ef (r56862).

Change-Id: I7e8accc35596d134c934a03072c3c3e99fd2aa0a
2015-12-03 13:45:46 +00:00
Aaron Schulz
6dedffc2d7 Move category membership RC updates to CategoryMembershipChangeJob
* Recursive link updates no longer mention an category changes.
  It's hard to avoid either duplicate mentioning of changes or
  confusing explicit and automatic category changes.
* LinksUpdate no longer handles this logic, but rather WikiPage
  decides to spawn this update when needed in doEditUpdates().
* Fix race conditions with calculating category deltas. Do not
  rely on the link tables for the read used to determine these
  writes, as they may be out-of-date due to slave lag. Using the
  master would still not be good enough since that would assume
  FIFO and serialized job execution, which is not garaunteed.
  Use the parser output of the relevant revisions to determine
  the RC rows. If 3 users quickly edit a page's categories, the
  old way could misattribute who actually changed what.
* Make sure RC rows are inserted in an order that matches that
  of the corresponding revisions.
* Better avoid mentioning time-based (parser functions) category
  changes so they don't get attributed to the next editor.
* Also wait for slaves between RC row insertions if there where
  many category changes (it theory it could well over 10K rows).
* Using a separate job better separates concerns as LinksUpdate
  should not have to care about recent changes updates.
* Added more docs to $wgRCWatchCategoryMembership.

Bug: T95501
Change-Id: I5863e7d7483a4fd1fa633597af66a0088ace4c68
2015-12-03 11:28:05 +00:00
Brad Jorsch
d032bb52cd Add a central ID lookup service
Anything that wants to be "central" right now has to depend on
CentralAuth, and then either can't work without CentralAuth or has to
branch all over the place based on whether CentralAuth is present. Most
of the time all it really needs is a mapping from local users to central
user IDs and back or the ability to query whether the local user is
attached on some other wiki, so let's make an interface for that in
core.

See I52aa0460 for an example implementation (CentralAuth), and Ibd192e29
for an example use (OAuth).

Bug: T111302
Change-Id: I49568358ec35fdfd0b9e53e441adabded5c7b80f
2015-12-02 14:50:36 -07:00
dcausse
353ae71963 Extracted some code from PrefixSearch for re-usability by other search engines.
(This patch is needed for Ida9b9f8)

Bug: T112028
Change-Id: I35aece88333a65f6b1f55f7a87e2d14de4f5bea7
2015-12-02 17:18:08 +00:00
Reedy
5d032c0f65 Rename wfBaseConvert.php maintenance script
Change-Id: I3174ceb040e9029ad8049a3e49c119bfac4aa386
2015-11-24 23:34:21 +00:00
jenkins-bot
8732532d47 Merge "Implement HTMLComboboxField" 2015-11-24 19:20:07 +00:00
jenkins-bot
899bd46cbb Merge "Add script to fix content model of JSON pages" 2015-11-24 18:53:43 +00:00
Kunal Mehta
2986d47c90 Add script to fix content model of JSON pages
MediaWiki:Foo.json and User:Foo/bar.json pages now have a default
content model of JSON, but existing pages using those names will be set
to defaults of wikitext.

The content models of those pages are now set to "json", unless it has
invalid syntax, in which case it will be set to "wikitext".

For convenience, the script is automatically run as part of update.php.

Bug: T108663
Change-Id: I1412937ccea8e65dba58580beec79cbf2286ae01
2015-11-24 10:08:44 -08:00
jenkins-bot
aa5e579028 Merge "Move details of import logs into log params" 2015-11-24 08:52:12 +00:00
Brad Jorsch
42e257a1a2 API: Remove dbg, txt, and yaml formats
Per RFC: https://www.mediawiki.org/wiki/Requests_for_comment/Ditch_crappy_API_formats

Bug: T95715
Change-Id: I8e4e9ad3c96504cf4587cb4632504eff21b5ff75
2015-11-18 09:19:51 -05:00
Bartosz Dziewoński
77d759aab4 Implement HTMLComboboxField
It's a dropdown select with the ability to add custom options, or a
text field with input suggestions, whichever you prefer.

This is meant to be a replacement for HTMLSelectOrOtherField and
HTMLAutoCompleteSelectField.

In regular HTML mode, it uses HTML5 `<datalist>` element with no
custom JavaScript. This is supported by a wide range of browsers
(IE 10+, modern Firefox and Chrome, Opera 12+).

In OOUI mode, it uses a ComboBoxInputWidget.

Depends on: I14b40884f185fb4e5

Bug: T118119
Change-Id: I954d3d24ed4efe90be9596a1bd9586ba3aee1e23
2015-11-12 09:48:27 +01:00
umherirrender
dc78d4d12c Move details of import logs into log params
The detail information about the count of revision and the interwiki
title get moved into log params. To show the new information an
ImportLogFormatter was written, which changes the key for new log items.

This allows to show the detail information in the user language.
It also decouple the user supplied data from detail information

Change-Id: Iaa57da0fc3e20c33c94fd850cd02db96fdb32dac
2015-11-11 18:34:18 +01:00
Timo Tijhof
304eaf2868 objectcache: Reduce MediaWiki-specificness from Memcached classes
Follows-up f36b73e96c, which moved these classes to libs/objectcache.

* Fix wrong @throws in MemcachedPeclBagOStuff.
* Fix wrong @returns in MemcachedBagOStuff::getClient().
* Rename MWMemcached to MemcachedClient.
* Remove mention of 'memcached.php', which doesn't exist anymore.

Change-Id: I34dbc859be4778cea489fd2344f233f30452605c
2015-11-10 03:32:58 +00:00
aude
b0c81a3e09 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
2015-11-04 13:43:32 +01:00
Ori Livneh
8340400f27 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
2015-11-03 15:05:37 -08:00
jenkins-bot
41f9c91545 Merge "Add script to find orphaned LocalRepo files" 2015-11-03 10:48:31 +00:00
Reedy
d9d22e8f0b Remove ORM code from core
Bug: T114538
Change-Id: Ic4196ca9da927fc5c85b01cfff65f0636e3202ae
2015-10-29 13:06:36 +00:00
Aaron Schulz
828b598911 Add script to find orphaned LocalRepo files
Bug: T111838
Change-Id: I60ac7f3451c8240a0716933dcfff413669458206
2015-10-29 01:59:10 -07:00
Timo Tijhof
e8275758fe objectcache: Introduce IExpiringStore for convenient TTL constants
Also consistently use self:: instead of BagOStuff:: for constants
referenced within the BagOStuff class.

Change-Id: I20fde9fa5cddcc9e92fa6a02b05dc7effa846742
2015-10-28 04:07:25 +00:00
Ori Livneh
e9d64a69bc Replace local RunningStat with wikimedia/running-stat library
* mediawiki/vendor change: I66b419c8168df.
* Add back-compat shim in includes/compat/RunningStatCompat.php.

Change-Id: Ibad4dc0ce5aa8697791865ed8ea61a25bae7b3e0
2015-10-27 19:16:58 +00:00
Perside Rosalie
6ba942258a 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
2015-10-26 15:58:03 +00:00
Aaron Schulz
f36b73e96c Move some memcached classes to /libs
Also removed a few MW dependencies from MemcachedPeclBagOStuff.
It still uses an IP class method, so it has to stay for now.

Change-Id: I8c5c83046c58fb58091d6ce11b2385208262460f
2015-10-24 15:27:42 -07:00
Aaron Schulz
cce813a922 Move MultiWriteBagOStuff to /libs
Also moved related tests files to /libs.

Change-Id: I806eeaa30205733d497adde933baf0c4157f7aae
2015-10-24 12:15:26 -07:00
Aaron Schulz
660a775931 Remove old ProfilerOutputUdp class
This uses a non-standard output and requires a custom
collector that wmf does not maintain nor use anymore.

Change-Id: I41a68f7061465417fbdc5ca41f8eb6e1f99f1111
2015-10-21 20:59:47 -07:00
Reedy
8c8383a53d Remove unused ApiQueryORM
Bug: T114538
Change-Id: I4673977cef336ab3b4e375a3deab4d4fc67830eb
2015-10-15 17:01:38 +00:00
jenkins-bot
5b1d551953 Merge "Improve error message for missing content model on import" 2015-10-12 13:55:12 +00:00
This, that and the other
cdc36570ea Improve error message for missing content model on import
I was initially going to refactor out the error message into Import.php,
but it quickly became apparent that WikiImporter's error handling needs a
LOT of work. In particular, to localise the error message into the user's
language is sadly non-trivial.

Although not used currently, the MWUnknownContentModelException subclass
will help with error handling improvements in the future.

Bug: T49270
Change-Id: I9f53c9d6a8a2ea842cb2ba94d4131e10a8b08f5d
2015-10-10 19:51:20 +11:00
Aaron Schulz
a8ec2f8daf Move SquidPurgeClient under /clientpool
Each class has its own file now too.

Change-Id: I11593d6efbfce8e3981895e84edb4e0dea3998e4
2015-10-08 00:37:49 -07:00
jenkins-bot
f0b51b4200 Merge "API: Add ApiQueryAllRevisions" 2015-10-07 16:38:35 +00:00
Timo Tijhof
6d412cf028 Move WebRequestUpload class to its own file
Moving out of WebRequest.php. It's not even a subclass.

Change-Id: I87e5c01afe215a084e39b442c65d22d9d0cc1015
2015-10-06 19:24:58 -07:00
jenkins-bot
12ce3c8e8d Merge "Enforce lagged-slave read-only mode on the DB layer" 2015-10-07 01:40:34 +00:00
Ori Livneh
da3443bfa2 Add MemoizedCallable for APC-backed function memoization
Add a simple class to `libs/` for memoizing functions by caching return values
in APC. I decided not to make this an external library just yet because I see
this as potentially a part of a larger functional programming library.

Doesn't use APCBagOStuff for two reasons: (1) avoid dependency on MediaWiki
code; (2) ability to pass third &$success parameter to apc_store, to
distinguish between cache misses and cached false values.

Use this in ResourceLoaderFileModule to cache CSSMin::remap.

Change-Id: I00a47983a2583655d4631ecc9c6ba17597e36b5f
2015-10-06 23:35:03 +00:00
Brad Jorsch
2516ca03ed API: Add ApiQueryAllRevisions
Bug: T113885
Change-Id: I43bdc1e33945dab27466fc047d78af5e65df1740
2015-10-06 12:32:12 -04:00
jenkins-bot
c5ac11e2eb Merge "Start rename of DatabaseBase => Database" 2015-10-05 23:45:36 +00:00
Aaron Schulz
a88df43d3f Database debug log cleanup (remove wgDebugDumpSqlLength/wgDebugDBTransactions)
* Simplify the debug log call and use queries group
* Remove $wgDebugDumpSqlLength, as profiler output
  already has shortened query strings (one can use
  profiling without DBO_DEBUG)
* Removed $wgDebugDBTransactions as BEGIN/COMMIT already show
* Removed PostgresTransactionState as it was only used for
  $wgDebugDBTransactions handling
* This cuts down on lots of global variable usage

Change-Id: I185adb1694441d074dea965960429b4910727620
2015-10-05 12:47:09 -07:00
Aaron Schulz
db170ebe78 Enforce lagged-slave read-only mode on the DB layer
* Most callers gracefully check wfReadOnly(),
  but fail in case they dont. This also catches
  foreign DBs which might slip through the cracks.
* Also remove useless wfDebug() call around
  mDoneWrites check as write queries show in
  the logs anyway.

Change-Id: I560ebd19c4eb2b3a040d4331702346440617cfaa
2015-10-05 05:41:19 +00:00
Aaron Schulz
1b67a929ab Start rename of DatabaseBase => Database
This gives static method callers the option
to use methods like Database::factory() instead
of having to use the uglier DatabaseBase::factory().

Change-Id: I61800626b71ad2803a897df060059dbaf8778679
2015-10-04 12:36:56 -07:00
Brad Jorsch
77d62edef3 Refactor hashing utility functions from MWCryptRand and make public
MWCryptRand already has some useful utility functions wrapping PHP's
hash() and hash_hmac(). Let's make them public so we can use them from
other code.

But since "MWCryptRand" isn't really a good place for hashing functions,
let's move them to "MWCryptHash" instead.

Change-Id: I7542c719ac72beba7b0f6aa170bdb4c69fa6beab
2015-10-01 01:18:23 +00:00
jenkins-bot
2cb893c085 Merge "Introduce CategoryMembershipChange" 2015-09-30 12:44:37 +00:00
Aaron Schulz
c0cb80beac Added DeleteLinksJob to support purging backlinks via job runners
* This jobs should only be constructed via relevant Content object,
  e.g. the result of enqueueUpdate() being called on a DataUpdate
  returned by Content::getSecondaryUpdates().
* Also modified LinksDeletionUpdate to support a $pageId parameter.
* LinksDeletionUpdate can now be enqueued to a DeleteLinksJob.

Change-Id: I650dcf0bd172ede0d61357ec158a4704ae1f2033
2015-09-29 17:40:19 -07:00
addshore
2fb2a3f14b Introduce CategoryMembershipChange
This is split from:
I03516bb34144d95e5f25c46ae98ab70ce699b31b

Change-Id: I27539d25ef3e81cf991657dffc0a62b9719d21d8
2015-09-29 23:59:34 +01:00
Kunal Mehta
9a3c7b43ea Move FileContentsHasher into includes/utils/
The class only contains two dependencies upon MediaWiki (ObjectCache &
wfGlobalCacheKey) which are suitable for inclusion in the utils
directory.

Change-Id: I85b4c763be2670c40f26d93e75cedcb68eaa7987
2015-09-24 18:27:28 -07:00
jenkins-bot
827e10dc40 Merge "Use wikimedia/cldr-plural-rule-parser" 2015-09-24 23:15:56 +00:00
Aaron Schulz
9f01cee8fa Moved all load balancer classes to /loadbalancer
* Also split out LBFactory classes to their own files

Change-Id: I9e649878afcffdb736c09c0574e5f99b1e72382f
2015-09-24 22:56:05 +00:00
Niklas Laxström
4a3fd2e42a Use wikimedia/cldr-plural-rule-parser
Replaces the parser included in MediaWiki with same code in
a library.

Change-Id: I1d2675466a543269e17faf213aa68d2b7afaf78e
2015-09-24 21:41:50 +02:00
jenkins-bot
173493f0ce Merge "resourceloader: Improve caching for LESS file compilation" 2015-09-24 00:44:39 +00:00
Ori Livneh
12afb3607d resourceloader: Improve caching for LESS file compilation
Caching the output of a LESS compiler is tricky, because a LESS file may
include additional LESS files via @imports, in which case the cache needs
to vary as the contents of those files vary (and not just the contents of
the primary LESS file).

To solve this, we first introduce a utility class, FileContentsHasher. This
class is essentially a smart version of md5_file() -- given one or more file
names, it computes a hash digest of their contents. It tries to avoid
re-reading files by caching the hash digest in APC and re-using it as long as
the files' mtimes have not changed. This is the same approach I used in
I5ceb8537c.

Next, we use this class in ResourceLoaderFileModule in the following way:
whenever we compile a LESS file, we cache the result as an associative array
with the following keys:

* `files` : the list of files whose contents influenced the compiled CSS.
* `hash`  : a hash digest of the combined contents of those files.
* `css`   : the CSS output of the compiler itself.

Before using a cached value, we verify that it is still current by asking
FileContentHasher for a hash of the combined contents of all referenced files,
and we compare that against the value of the `hash` key of the cached entry.

Bug: T112035
Change-Id: I1ff61153ddb95ed17e543bd4af7dd13fa3352861
2015-09-24 00:34:17 +00:00
Aaron Schulz
25a44aa3e4 Added support for enqueueable DataUpdates
* Updates can now declare themselves as having enqueueUpdate()
  as an alternative to doUpdate(). This lets more expensive
  or slave lag producing updates use the job queue if desired.
* Added a $mode flag to DataUpdate::runUpdates() to prefer
  pushing jobs over calling doUpdate().
* Made page deletions defer deletion updates when possible.

Bug: T95501
Change-Id: Ic6f50f92768089ba0fbc223b8d178f5a91512959
2015-09-23 12:07:41 -07:00
Aaron Schulz
918fed0ab5 Moved LinksDeletionUpdate to a separate file
* Also removed unused updateCategoryCounts() method

Change-Id: I25f64d3771a23d18e7993433dab449adec375d9b
2015-09-22 11:07:47 -07:00
jenkins-bot
35f61c7c4b Merge "registration: Allow extensions to specify which MW core versions they require" 2015-09-22 04:57:47 +00:00
Erik Bernhardson
f66559b616 Produce monolog messages through kafka+avro
This allows a logging channel to be configured to write
directly to kafka. Logs can be serialized either to json
blobs or the more compact apache avro format.

The Kafka handler for monolog needs a list of one of more
kafka servers to query cluster metadata from. This should be
able to use any monolog formatter, although some like
JsonFormatter require you to disable formatBatch as Kafka
protocol would prefer to encode each record independently in
the protocol.  This requires the nmred/kafka-php library,
version >= 1.3.0.

Adds a new formatter which serializes to the apache avro
format. This is a compact binary format which uses pre-
defined schemas. This initial implementation is very simple
and takes the plain schemas as a constructor argument.

Adds a new option to MonologSpi to wrap handlers in a
BufferHandler. This doesn't flush until the request shuts
down and prevents any network requests in the logger from
adding latency to web requests.

Related mediawiki/vendor update: Ibfe4bd2036ae8e998e2973f07bd9a6f057691578

The necessary config is something like:

array(
    'loggers' => array(
        'CirrusSearchRequests' => array(
            'handlers' => array( 'kafka' ),
        ),
    ),
    'handlers' => array(
        'kafka' => array(
            'factory' => '\\MediaWiki\\Logger\\Monolog\\KafkaHandler::factory',
            'args' => array( 'localhost:9092' ),
            'formatter' => 'avro',
            'buffer' => true,
        ),
    ),
    'formatters' => array(
        'avro' => array(
            'class' => '\\MediaWiki\\Logger\\Monolog\\AvroFormatter',
            'args' => array(
                array(
                    'CirrusSearchRequests' => array(
                        'type' => 'record',
                        'name' => 'CirrusSearchRequests'
                        'fields' => array( ... )
                    ),
                ),
            ),
        ),
    ),
)

Bug: T106256
Change-Id: I6ee744b3e5306af0bed70811b558a543eed22840
2015-09-21 12:45:23 -07:00
Kunal Mehta
cef1f31167 registration: Allow extensions to specify which MW core versions they require
This adds a "requires" property to extension.json, which extensions and
skins can use to indicate which versions of MediaWiki core they support.
The hacky wfUseMW() is now deprecated in favor of this.

Rather than writing our own version constraint and parser library, we
can re-use composer's, which was recently split out into a separate
library named "composer/semver" for this patch.

Any syntax accepted by composer[1] is available for usage here. Test
cases have been provided to demonstrate how versions are parsed. For now
it is recommended that people stick to expressing compatability with
stable versions (e.g. ">= 1.26").

This patch does not support requiring specific MediaWiki core WMF
branches, since those do not follow the standard semver format that
composer parses. If we are unable to parse $wgVersion, all checking will
be skipped and reported as compatible.

[1] https://getcomposer.org/doc/01-basic-usage.md#package-versions

Bug: T99084
Change-Id: I7785827216e16c596356d0ae42d6b30f3f179f10
2015-09-21 09:56:53 -07:00
jenkins-bot
f8659ae6ea Merge "SpecialMovepage: Convert form to use OOUI controls" 2015-09-15 22:40:01 +00:00
Tim Starling
e9d523b9bd Add Html5Depurate tidy driver
Also document input format for MWTidy::tidy().

Change-Id: I77071d3db0524695c2baf9a4670ca2455438c83d
2015-09-11 03:32:32 +00:00
Tim Starling
2c6c954e23 Abstract and refactor Tidy support
* Split tidy implementations into a class hierarchy
* Bring all tidy configuration into a single associative array and
  deprecate the old configuration.
* Remove $wgAlwaysUseTidy

This is preparatory to replacement of Tidy (T89331). I used the name
"Raggett" for things relating to Dave Raggett's Tidy, since if we use
"tidy" to mean the new abstract system as well as Raggett's tidy, it
gets confusing.

Change-Id: I77af1a16cbbb47fc226d05fb9aad56c58e8910b5
2015-09-10 20:18:52 -07:00
Bartosz Dziewoński
5befb9b747 SpecialMovepage: Convert form to use OOUI controls
Recreated the form with OOUI widgets. This required putting together
ComplexTitleInputWidget to handle the split namespace+title field on
this page.

Bug: T86865
Change-Id: Ice69df851137e3454ae2c9f4c75494b18cf8a75a
2015-09-01 21:03:38 +02:00
Ori Livneh
e8c17972dd Replace bundled IPSet library with composer dependency
Complete the 'librarization' of IPSet by replacing the code in core with a
dependency on the external library.

Change-Id: I789b4fb42ee1da44ea3d8e1db551b047e11a439e
2015-08-26 10:38:09 -07:00
Bartosz Dziewoński
2f30ff7a86 Introduce mediawiki.ForeignApi
mw.ForeignApi is an extension of mw.Api, automatically handling
everything required to communicate with another MediaWiki wiki via
cross-origin requests (CORS).

Authentication-related MediaWiki extensions may extend it further to
ensure that the user authenticated on the current wiki will be
automatically authenticated on the foreign one. A CentralAuth
implementation is provided in I0fd05ef8b9c9db0fdb59c6cb248f364259f80456.

Bug: T66636
Change-Id: Ic20b9682d28633baa87d22e6e9fb71ce507da58d
2015-08-21 17:00:01 +00:00
jenkins-bot
2766e4714c Merge "Refactor NamespaceInputWidget" 2015-08-21 15:32:59 +00:00
CSteipp
e412ff5ecc Revert "Enable users to watch category membership changes"
This reverts commit f6879ea16e.

Bug: T109638
Change-Id: I770d8d33a4cff3829bdea9a4df24de209cbe691b
2015-08-20 10:35:56 -07:00
Bartosz Dziewoński
b6046dff66 Refactor NamespaceInputWidget
* Refactor NamespaceInputWidget into two widgets: NamespaceInputWidget
  and ComplexNamespaceInputWidget. The former is now only the dropdown
  (and inherits from DropdownInputWidget), the latter is the dropdown
  plus two checkboxes.
* Change ComplexNamespaceInputWidget configuration to take nested config
  for `invert`, `associated`, and `namespace`, rather than require
  parameters like `invertName` and so on for every combination.
* Implement standalone JavaScript versions of both widgets (previously
  mw.widgets.NamespaceInputWidget could only be created via infusion
  of the PHP widget).

Bug: T99256
Bug: T106138
Bug: T109559
Change-Id: Ie2fee6d035339ceb934fca991675480db3d630d1
2015-08-20 15:10:51 +00:00
Kevin Israel
a7cb317188 Remove maintenance script fixSlaveDesync.php
Though this script was run on Wikimedia sites years ago (see T8399), there
are enough reasons to doubt it will be run again:

* There is a hardcoded maximum page_id value, which would have to be
  changed or removed before reuse.
* It scans the entire page table in a single SELECT query and stores all
  values of page_id and page_latest in a PHP array, which might not be
  feasible on a large wiki.
* It writes directly to slaves. In contrast, the manual page for
  pt-table-sync (from Percona Toolkit) says in general, "[...] it always
  makes the changes on the replication master, never the replication slave
  directly. This is in general the only safe way to bring a replica back
  in sync [...]".
* It only works on the page/revision/text tables. In contrast, pt-table-sync
  can work on any table having a primary key.
* It does try to detect whether revisions are missing on the master (instead
  of on the slave). However, this won't work because of a bug introduced in
  r91243 / bb1df74f87 (it actually queries the master twice and puts the
  second result set in $slaveIDs).

Change-Id: I85c98821af308abf7dde8068d7cbca17d06b1362
2015-08-19 06:33:53 -04:00
jenkins-bot
f6b7ffab94 Merge "Migrate move protect log to new log system" 2015-08-18 23:17:03 +00:00
umherirrender
3964b4cc05 Migrate move protect log to new log system
Migrate the move protect log as first sub type of the protection log,
because it does not have complex log parameter, which needs some way of
handling/migration.
It also keeps the gerrit change smaller and hopefully makes review
easier.
The other sub types of the protection log will be migrated in a later
patch set.

This allows use of gender on Special:Log. Old message is kept for use
in IRC. A test was added to ensure an unchanged IRC message.

Bug: T47988
Change-Id: I57b3bd8a7dc823acdbb56520d2364f5542283373
2015-08-18 22:20:35 +00:00
jenkins-bot
0ea03a7f56 Merge "Enable users to watch category membership changes" 2015-08-14 06:58:48 +00:00
jenkins-bot
811e45ae56 Merge "Import BatchRowUpdate classes from Echo" 2015-08-14 01:38:50 +00:00
Erik Bernhardson
85d5626d6c Import BatchRowUpdate classes from Echo
This is a set of classes written for Echo to simplify writing
maintenance scripts that iterate over an entire table and update
some of those rows.

This has shown to be reusable elsewhere, especially the BatchRowIterator
class and will be useful to have generally avilable in core. The Echo
classes are all prefixed with the Echo name so there wont be any
conflict is both are installed.

Change-Id: I64c1751106caf34f41af799dbaf8794115537f06
2015-08-13 21:28:13 -04:00
Kai_WMDE
f6879ea16e Enable users to watch category membership changes
Bug: T9148
Change-Id: I5a89d8f19804b1120f4c755d834e2da6ca12ceae
2015-08-13 17:58:06 +02:00
Aaron Schulz
0086965fd0 Removed ScopedPHPTimeout; unused
Change-Id: Ic3a3500ddd410c68a30d3f3d1947f632e1aff5fd
2015-08-10 11:29:11 -07:00
jenkins-bot
d2278d1c2a Merge "Added DBAccessObjectUtils class to avoid duplication" 2015-08-03 23:26:15 +00:00
Gergő Tisza
e56f7b6c63 Sample StatsD messages when instructed
Bug: T106457
Change-Id: I8ddb5a53dcbaf398f5a114d2a4a862842e980db4
2015-08-03 22:09:18 +00:00
Kunal Mehta
f318d7a04b Add base interface for setters in RequestContext and DerivativeContext
Change-Id: I819633ca5344f73a196623569bb58fd8372d6779
2015-08-03 11:55:41 +00:00
jenkins-bot
78721711d7 Merge "Monolog: Add Formatter that uses MWExceptionHandler::getRedactedTraceAsString" 2015-07-31 19:52:02 +00:00
Bryan Davis
27dcc9f051 Monolog: Add Formatter that uses MWExceptionHandler::getRedactedTraceAsString
Add a Monolog Formatter class that uses
MWExceptionHandler::getRedactedTraceAsString when outputting stack
traces.

Bug: T107440
Change-Id: Ic580c137e27aac95435f7b073a18cf61820b172f
2015-07-31 13:02:39 -06:00