Allows scripts to edit pages that can vary by language, e.g. "{{int:mainpage}}"
or target pages using parser variables, e.g. "News_{{CURRENTYEAR}}".
Change-Id: I94bd613d34743739c6529f22c1dcccc27acc4e8b
Changes since 2.2.4:
* Fix minify CLI to work from within vendor directory.
* Remove true/false !0/!1 micro optimisation. (T237042)
Depends-On: Id2f2061ac5c7389840b73ad138a91df73a40877f
Change-Id: I1f437781dd8f0cea516693a6e15fe3f95a0aa2ad
Currently for every File page view, if the file is local,
CommonsMetadata extension renders the file page twice -
once to extract the metadata, and once to show the page.
Metadata extraction parse was always uncached, so let's
at least use PoolCounter and ParserCache for this parse.
Bug: T292302
Change-Id: If6e1a1a72d794f4fb87105b7528ea0afe92a585f
Update method name in ContentHandler, soft-deprecate method on Content.
This will require making a semi-backwards-incompatible
change no matter what, we don't really have a great way
of hard-deprecating overriding methods.
Replace all callers of Content::prepareSave in core.
Add tests for ContentHandler::validateSave.
Bug: T287159
Change-Id: I7f23e6e97b1c7d27a6aaefdb88b19b2fc6e8b3a8
It wasn't obvious to me that the mediawiki.org link actually pointed
to specific instructions for resolving the error, as opposed to
just telling the user to search on mediawiki.org. Try to make this
a bit more obvious.
Change-Id: Id9a6cf9ee2520db9d405e17eaf34b10bd72897f3
The new style of checking for the last error during a section of
calls is more robust since it allows nesting of callers. Typically,
an external caller will want to watch a section of code that will
involve zero or more internally watched sections. Errors that are
seen internally (leading to a failing response) should also be
visible externally.
Replace internal BagOStuff clearLastError() calls.
Replace WANObjectCache clearLastError() calls. Such a class should not
clear the error codes since the class is effectively "internal". Callers
that are more meaningfully "external" might want to check the errors.
Cleanup "last" error handling for proxy backends.
Change-Id: I281817a85602967c0ec2bdd23a5d8be101680b64
Slow fatal, before:
> DBTransactionSizeError:
> Transaction spent 3.016772747039795 second(s) in writes,
> exceeding the limit of 3
After:
> DBTransactionSizeError:
> Transaction spent 3.016s in writes, exceeding the 3s limit
Fast debug, before:
> [DBPerformance] Transaction spent 0.015979528427124 second(s) in
> writes, less than the limit of 3
After:
> [DBPerformance] Transaction spent 16ms in writes, under the 3s limit
Test plan:
* Set `$wgMaxUserDBWriteDuration = 3;` in LocalSettings.php.
* Perform a db-writing user action, such as an edit.
* Check mw debug log.
* Set `$wgMaxUserDBWriteDuration = 0.0001;` in LocalSettings.php,
and ensure `$wgShowExceptionDetails = true;` is set as well
(default if using official dev environments, or otherwise
including DevelopmentSettings.php, otherwise check exception log),
or add an artificial delay in DatabaseMysqli::doQuery().
* Perform a user action, and observe the fatal error.
Change-Id: Ice91ad25a836c4d9a824f9c0f6ec8debaad46adc
With a user-friendly error message which uses both technical and
non-technical language, without the irrelevant detail of filebackend
URLs.
Bug: T283045
Change-Id: I8704f405d38acdffae7bd4ea5b91f3f591fc2ebc
The shellouts to djvudump and djvutxt are combined with a wrapping shell
script, scripts/retrieveMetaData.sh so the djvu file only needs to be
transmitted to a Shellbox service once.
Windows users can change the new $wgDjvuShell setting to point to a
different shell.
Bug: T289228
Change-Id: Ic4e3dff246792692a952da0e8f9b4a83d1b6b963
* Replace `substr`/`substring` with `slice`. The second argument
to `substring` is length, not end index as in `substr`/`slice`,
so convert where necessary.
* Replace `new Date().getTime()` with `Date.now()`
* Documentation fixes
* Replace `throw Error` with `throw new Error`
Change-Id: I532500ea4c99d8ebec01efb21273c8df21626e59
The null check for the class property packageFiles needs change to
check the return value of the function instead, because Phan would
report an issue that a null value is used in the foreach.
Phan does not understand the relation between the return value and the
class property.
When using a local variable then Phan can check
that the value is never null when used.
Change-Id: I48ac8a8fe55ae7b4e13bc94d2f2d2ede01fbc68b
The property was set, but never read. Use it similar to
mHeaderVariant/mURLVariant and return the value when set.
Originally introduced without caching (r60961, 81f62b6f61) but had no
clear explanation. The unclear comment was removed in I62bd09d7d0.
Change-Id: I863d77618c7f26686ae4de76024878655f516e04
This reverts commit 2bcb3fe567.
Reason for revert: this is a good change,
just needed more work to not break CI
Change-Id: I23768bee242e3cf81b1493a740cf070e7ad1e224
The method is marked unstable, since it's not encouraged to override
this. The HTML construction should be moved to a template / hook based
system.
Also remove deprecated global $wg variable access in favor of injected
Config.
Bug: T295068
Change-Id: I93b559bbb1612608785cf5633e8973c45c421171
phan says that $this->mainCollator is not documented to get null
assigned.
Use a local variable to check for null and than set the class property.
Change-Id: I000c935da8d99184f2ae0382fc5caac81e80c8d7