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
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
* 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
* 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
* 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
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
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
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
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
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
SiteObject and SiteArray were deprecated in 1.21 and
can't find any use of them anywhere else in gerrit.
Change-Id: Iff3ba8a60ac9566998cce828c4034066fdefe804
* 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
Also consistently use self:: instead of BagOStuff:: for constants
referenced within the BagOStuff class.
Change-Id: I20fde9fa5cddcc9e92fa6a02b05dc7effa846742
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
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
This uses a non-standard output and requires a custom
collector that wmf does not maintain nor use anymore.
Change-Id: I41a68f7061465417fbdc5ca41f8eb6e1f99f1111
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
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
* 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
* 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
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
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