jenkins-bot [Thu, 23 Aug 2018 19:41:16 +0000 (19:41 +0000)]
Merge "Don't reset name tables between test runs."
jenkins-bot [Thu, 23 Aug 2018 18:18:56 +0000 (18:18 +0000)]
Merge "resourceloader: Implement mw.inspect 'time' report"
jenkins-bot [Thu, 23 Aug 2018 18:10:57 +0000 (18:10 +0000)]
Merge "Make sure we don't try to use a deleted rev ID."
Timo Tijhof [Tue, 10 Jul 2018 00:28:55 +0000 (17:28 -0700)]
resourceloader: Implement mw.inspect 'time' report
When enabling $wgResourceLoaderEnableJSProfiler, mw.loader gets instrumented
with the following timing values for each of the modules loaded on the page:
* 'total' - This measures the time spent in mw.loader#execute(), and
represents the initialisation of the module's implementation, including
the registration of messages, templates, and the execution of the 'script'
closure received from load.php.
* 'script' – This measures only the subset of time spent in the internal
runScript() function, and represents just the execution of the module's
JavaScript code as received through mw.loader.implement() from load.php.
For user scripts and site scripts, this measures the call to domEval
(formerly known as "globalEval").
* 'execute' - This measures the self time of mw.loader#execute(), which is
effectively `total - script`.
To view the report, enable the feature, then run `mw.inspect( 'time' )` from
the browser console, which will render a table with the initialisation
overhead from each module used on the page.
Bug: T133646
Change-Id: I68d1193b62c93c97cf09b7d344c896afb437c5ac
daniel [Wed, 22 Aug 2018 16:02:49 +0000 (18:02 +0200)]
Don't reset name tables between test runs.
Resetting the content_model and slot_role tables between test runs
requires the corresponding NameTabelStore instances to be reset
as well. We may however have many of them, buried in various services.
There is no easy way to reset them consistently.
Letting information in these tables persist between tests seems
harmless. Tests that need these tables reset can simply add them
to the tablesUsed array.
This is needed for unit tests to work with the new MCR schema.
Bug: T198561
Change-Id: I63e61e1ab74e00c20930a83d3a3f5df53092a197
jenkins-bot [Thu, 23 Aug 2018 17:10:34 +0000 (17:10 +0000)]
Merge "docs: Remove Doxyfile searching for .php5 and upper-case file extensions"
jenkins-bot [Thu, 23 Aug 2018 17:05:19 +0000 (17:05 +0000)]
Merge "API: Catch Errors as well as Exceptions"
jenkins-bot [Thu, 23 Aug 2018 16:19:59 +0000 (16:19 +0000)]
Merge "rdbms: make schema/prefix handling more consistent in LoadBalancer"
Brad Jorsch [Thu, 26 Jul 2018 21:24:59 +0000 (17:24 -0400)]
ApiComparePages: Update for MCR
The main external change here is that it can now return diffs per slot,
and the various parameters for providing text are deprecated in favor of
templated per-slot versions.
Also, this deprecates the 'fromsection' and 'tosection' behavior
introduced for T183823 (extracting a section's content for the diff) in
favor of the more logical behavior requested in T185723 (expanding
'fromtext-{slot}'/'totext-{slot}' as if for a section edit).
Bug: T200569
Bug: T183823
Bug: T185723
Change-Id: I700edfa766bbc320887f2e0b7507fcdb11e72cdc
jenkins-bot [Thu, 23 Aug 2018 07:55:28 +0000 (07:55 +0000)]
Merge "filebackend: Use $tmpDirectory instead of wfTempDir()"
Aaron Schulz [Wed, 22 Aug 2018 09:28:09 +0000 (02:28 -0700)]
rdbms: make schema/prefix handling more consistent in LoadBalancer
Move "tablePrefix" logic to LoadBalancer::reallyOpenConnection and
make it more consistent for local vs foreign connections. The prefix
for local connections is now set even if $domain does not provide a
database.
Also set the schema even if $domain does not provide a database.
Typically a database domain is either fully specified or comes from
DatabaseDomain::newUnspecified(), but there's no reason not to use
at least the schema/prefix of otherwise unspecified domains. The only
other sensible option would be some sort of exception.
Change-Id: Ib52f4b69e429810e3c5eac92a48aecf7b22e86e6
Timo Tijhof [Thu, 23 Aug 2018 00:35:57 +0000 (01:35 +0100)]
docs: Remove Doxyfile searching for .php5 and upper-case file extensions
Change-Id: I36bf74bb5e3a7c7e61cddd69ea371f94c8b9a856
Timo Tijhof [Thu, 23 Aug 2018 00:14:52 +0000 (01:14 +0100)]
filebackend: Use $tmpDirectory instead of wfTempDir()
Follows-up
f7e3ac3f95c.
Change-Id: I9583e126e596641956ca3f6646fe4e52eeaca9a2
Jayprakash12345 [Wed, 22 Aug 2018 18:53:05 +0000 (00:23 +0530)]
Fix typo in formDescriptor array
Bug: T202550
Change-Id: I06c6cf596ab0f159ad6a50251788ff3917125ae7
Translation updater bot [Wed, 22 Aug 2018 20:14:16 +0000 (22:14 +0200)]
Localisation updates from https://translatewiki.net.
Change-Id: I09f190dad5896844071db77b24ca54829b214976
jenkins-bot [Wed, 22 Aug 2018 20:09:12 +0000 (20:09 +0000)]
Merge "OOUIfy CheckMatrix in PHP and JS"
Brad Jorsch [Wed, 22 Aug 2018 15:59:56 +0000 (11:59 -0400)]
Make sure we don't try to use a deleted rev ID.
MySQL until 8.0 and MariaDB until some version after 10.1.34 don't save
the auto-increment value to disk, so on server restart it might reuse
IDs from deleted revisions. We can fix that with an insert with an
explicit rev_id value, if necessary.
Bug: T202032
Change-Id: I14e5b6c8ec8b5f1aeb2305fae4b103665f8f6686
Moriel Schottlender [Thu, 26 Jul 2018 23:14:41 +0000 (16:14 -0700)]
OOUIfy CheckMatrix in PHP and JS
This is to make sure that the design is similar, but also so
that the widget can be read in JS where needed and that we
can toggle the disabled state on/off through the whole widget,
that is made from a series of checkbox widgets.
Bug: T199946
Change-Id: I9943b0aa1746fdfb60c7d4c88d6d4d7ac0589a2c
Brad Jorsch [Tue, 21 Aug 2018 15:19:15 +0000 (11:19 -0400)]
API: Catch Errors as well as Exceptions
ApiMain (and also api.php) tries to catch any Exception so as to provide
a properly-formatted error message to the client instead of an HTML
error page.
With PHP 7.0, some cases that produce an Exception in HHVM instead
produce an Error. The API code should catch these too.
Fortunately neither Zend PHP nor HHVM care if you try to catch a class
that doesn't exist, so we can just add catch blocks for Throwable and
not worry about it.
Bug: T202416
Change-Id: I189eee466bd09870bc172f2420be393a7c0b1900
jenkins-bot [Wed, 22 Aug 2018 13:18:23 +0000 (13:18 +0000)]
Merge "Disable warning about direct text table access for now"
jenkins-bot [Wed, 22 Aug 2018 11:43:13 +0000 (11:43 +0000)]
Merge "benchmarks: Minor cleanup for strtr benchmark"
jenkins-bot [Wed, 22 Aug 2018 11:15:03 +0000 (11:15 +0000)]
Merge "maintenance: Move backup.inc to a regular php class file"
Tim Starling [Wed, 22 Aug 2018 06:47:04 +0000 (16:47 +1000)]
The BlobStoreFactory constructor needs an LBFactory
BlobStoreFactory::newBlobStore() takes a wiki ID as a parameter, so it
needs an LBFactory to fetch the correct LoadBalancer from.
Bug: T202483
Change-Id: I834cd95251d76cb862600362525faf60d4e170b9
jenkins-bot [Wed, 22 Aug 2018 05:09:24 +0000 (05:09 +0000)]
Merge "Improve test coverage for ApiStashEdit"
jenkins-bot [Wed, 22 Aug 2018 05:06:36 +0000 (05:06 +0000)]
Merge "rdbms: fix a few IDEA warnings in Database"
jenkins-bot [Wed, 22 Aug 2018 05:01:43 +0000 (05:01 +0000)]
Merge "rdbms: fix IDEA warnings in DatabaseMssql.php"
jenkins-bot [Wed, 22 Aug 2018 04:53:32 +0000 (04:53 +0000)]
Merge "Optimize TitleFormatter::getPrefixedText() to Title performance"
jenkins-bot [Wed, 22 Aug 2018 04:53:26 +0000 (04:53 +0000)]
Merge "TitleFormatter: Implement
fbc144965315 and unify prefix logic"
Aaron Schulz [Wed, 22 Aug 2018 04:25:48 +0000 (21:25 -0700)]
rdbms: fix a few IDEA warnings in Database
Change-Id: I1bdca5c643ff81eb822443b8e45f71f5f3fb2155
Aaron Schulz [Wed, 22 Aug 2018 03:14:26 +0000 (20:14 -0700)]
rdbms: fix IDEA warnings in DatabaseMssql.php
Change-Id: Iffef01cfac4c714c768190e375bc873a2d3eaf2f
jenkins-bot [Wed, 22 Aug 2018 02:43:24 +0000 (02:43 +0000)]
Merge "rdbms: make Database::open() protected"
Aaron Schulz [Wed, 22 Aug 2018 01:34:51 +0000 (18:34 -0700)]
rdbms: make Database::open() protected
This is not called externally and there is little reason for that to
change. The current caller pattern is to use factory(), possibly with
initConnection() afterwards, or to use a LoadBalancer to begin with.
Change-Id: Ib1fdd5c960f1ed877fcd17bcb99b999d5d894716
jenkins-bot [Wed, 22 Aug 2018 00:55:46 +0000 (00:55 +0000)]
Merge "mediawiki.inspect: Remove redundant code for old Opera"
Aryeh Gregor [Tue, 10 Apr 2018 13:45:53 +0000 (16:45 +0300)]
Improve test coverage for ApiStashEdit
Change-Id: I1b7d95e074a7f101d13398a32898b74145ab4056
jdlrobson [Tue, 21 Aug 2018 19:46:00 +0000 (12:46 -0700)]
mediawiki.user: Rename stickyRandomId to getPageviewToken
New name is more descriptive and consistent with
how we use it.
Given the couple of usages in code, deprecate
the old method
Bug: T201124
Change-Id: Id43e9d3f3e687133c98017d24c10c307a5a855a1
Translation updater bot [Tue, 21 Aug 2018 21:11:34 +0000 (23:11 +0200)]
Localisation updates from https://translatewiki.net.
Change-Id: Ied09cc4e417eff17b85e6e9da293ae09bdf55fb2
jenkins-bot [Tue, 21 Aug 2018 20:52:13 +0000 (20:52 +0000)]
Merge "Add a maintenance script to add a Change Tag"
Timo Tijhof [Tue, 21 Aug 2018 20:45:59 +0000 (21:45 +0100)]
mediawiki.inspect: Remove redundant code for old Opera
Opera < 12 is no longer supported in Grade A, which means this
condition can't be reached, unless the variable exists by accident
in a supported browser where we don't want it to (e.g. due to
a gadget, or legacy element-by-id globals)
Change-Id: I2d840ff23397e78a11a6495b90247d3baf124ee5
jenkins-bot [Tue, 21 Aug 2018 19:49:43 +0000 (19:49 +0000)]
Merge "Skin: Avoid redirect=no for links to non-redirects"
jenkins-bot [Tue, 21 Aug 2018 18:40:36 +0000 (18:40 +0000)]
Merge "ChangeTag::createTagWithChecks calls ChangeTag::canCreateTag()"
Reedy [Tue, 21 Aug 2018 17:36:45 +0000 (18:36 +0100)]
Add a maintenance script to add a Change Tag
Change-Id: I51406b0e9140e5a462d9dd256b1d949fa09b67a0
Reedy [Tue, 21 Aug 2018 18:09:24 +0000 (19:09 +0100)]
ChangeTag::createTagWithChecks calls ChangeTag::canCreateTag()
It doesn't call ChangeTag::canDeleteTag()
Change-Id: Ib53c1b8e5f12aeaaff2eb3a704af6d29560b2ab6
jenkins-bot [Tue, 21 Aug 2018 18:04:00 +0000 (18:04 +0000)]
Merge "jquery.accessKeyLabel: Optimise by using mw.message().plain()"
jenkins-bot [Tue, 21 Aug 2018 17:53:29 +0000 (17:53 +0000)]
Merge "maintenance: Add maintenance script for managing foreign resources"
jenkins-bot [Tue, 21 Aug 2018 17:53:23 +0000 (17:53 +0000)]
Merge "resources: Move non-jquery files from /resources/lib/jquery to /resources/lib"
Timo Tijhof [Sun, 19 Aug 2018 05:14:05 +0000 (06:14 +0100)]
maintenance: Add maintenance script for managing foreign resources
Something for the short-term, perhaps. But at least an improvement
over 'update-oojs.sh' and 'update-ooui.sh'.
* Does not require any dependencies (no 'node' or 'npm').
* Performs integrity validation.
Change-Id: I0f79b84ef3903756353c66d3c3ee7e492c60e648
Timo Tijhof [Tue, 21 Aug 2018 04:45:43 +0000 (05:45 +0100)]
jquery.accessKeyLabel: Optimise by using mw.message().plain()
Avoids invoking mw.message#text, which uses the parser() of jqueryMsg,
twice for each call to jquery.accessKeyLabel.
These two messages do not contain any wikitext features, and are
not expected to need them in the future.
To make this explicit, add `{{format|plain}}` to their documentation,
and change the code to use plain().
Bug: T202357
Change-Id: I642f09afda4a93a1208550d44072f0909dcabdd0
jenkins-bot [Tue, 21 Aug 2018 14:57:19 +0000 (14:57 +0000)]
Merge "Load styles in 'oojs-ui-widgets' again rather than a separate module"
jenkins-bot [Tue, 21 Aug 2018 14:57:13 +0000 (14:57 +0000)]
Merge "Add Special:Search sort parameter without ui"
jenkins-bot [Tue, 21 Aug 2018 14:57:08 +0000 (14:57 +0000)]
Merge "SpecialMovepage: Use 'helpInline' for "Move associated talk page" checkbox"
jenkins-bot [Tue, 21 Aug 2018 14:04:56 +0000 (14:04 +0000)]
Merge "[MCR] Render multi-slot diffs"
jenkins-bot [Tue, 21 Aug 2018 12:00:31 +0000 (12:00 +0000)]
Merge "Create DifferenceEngine before calling GetDifferenceEngine"
jenkins-bot [Tue, 21 Aug 2018 11:08:00 +0000 (11:08 +0000)]
Merge "ChangeTags: Fix double escaping of tag descriptions"
jenkins-bot [Tue, 21 Aug 2018 10:35:04 +0000 (10:35 +0000)]
Merge "Ignore CentralIdLookup::resetCache() in code coverage reports"
Kunal Mehta [Tue, 21 Aug 2018 07:18:50 +0000 (00:18 -0700)]
Ignore CentralIdLookup::resetCache() in code coverage reports
Change-Id: I4c3603354b0aa9396f620b9894d384e676db7f95
jenkins-bot [Tue, 21 Aug 2018 05:46:33 +0000 (05:46 +0000)]
Merge "benchmarker: Implement setupEach for per-iteration setup"
jenkins-bot [Tue, 21 Aug 2018 03:12:13 +0000 (03:12 +0000)]
Merge "Chinese Conversion Table Update 2018-2"
Roan Kattouw [Tue, 21 Aug 2018 01:54:39 +0000 (18:54 -0700)]
ChangeTags: Fix double escaping of tag descriptions
truncateTagDescription() was escaping its return value for HTML, even
though it had just produced plain text, and all similar functions
return plain text as well.
Bug: T192509
Change-Id: Ieaa631ef19c235121af9d8e09f2674f54fa3c25a
jenkins-bot [Tue, 21 Aug 2018 00:37:00 +0000 (00:37 +0000)]
Merge "Fix FOUC for floated collapsible elements outside the content area"
jenkins-bot [Tue, 21 Aug 2018 00:36:55 +0000 (00:36 +0000)]
Merge "Resolve deprecation warnings in iw search widget"
Roan Kattouw [Tue, 21 Aug 2018 00:02:25 +0000 (17:02 -0700)]
Fix FOUC for floated collapsible elements outside the content area
There was CSS setting the correct float value, but it only worked on
elements inside the content area because it used .mw-content-ltr and
-rtl. Add another rule to catch things outside the content area (which
should float based on the UI language).
Bug: T198774
Change-Id: I29b71a2e52139e540d719b61964084170d36bc5e
jenkins-bot [Mon, 20 Aug 2018 22:22:05 +0000 (22:22 +0000)]
Merge "Fix handling categorization changes"
Erik Bernhardson [Mon, 20 Aug 2018 21:58:25 +0000 (14:58 -0700)]
Resolve deprecation warnings in iw search widget
The old iteration api has been deprecated, but looks like this
call wasn't caught in the patch that introduced it.
Change-Id: I435bacdb185e09127606217982ca70a1bec60301
jenkins-bot [Mon, 20 Aug 2018 21:55:28 +0000 (21:55 +0000)]
Merge "tests: Replace Bugddddd with Tddddd in test names, test strings"
Fomafix [Sat, 18 Aug 2018 13:51:29 +0000 (15:51 +0200)]
tests: Replace Bugddddd with Tddddd in test names, test strings
Change-Id: Ic6fbc5e14b1a756f62dd6cc3a6b2acc0d47db498
Timo Tijhof [Sun, 19 Aug 2018 21:23:51 +0000 (22:23 +0100)]
resources: Move non-jquery files from /resources/lib/jquery to /resources/lib
Per discussion on T193826, these are not part of jquery (the library, or the
module), and should not be in the same subdirectory.
To follow the new convention that all entries directly in /resources/lib
should correspond to single library only (either as file, or as directory),
move them one directory up.
Bug: T193826
Change-Id: I24c05ec5fc5f0a2d54d501a4a022d829675bf850
James D. Forrester [Mon, 20 Aug 2018 20:18:31 +0000 (13:18 -0700)]
Remove wgPasswordSenderName from DefaultSettings.php
This was removed from MediaWiki in 1.23 already, but was still
lingering in DefaultSettings.
Follow-up to: I578341430f53bef6d02b8ad78c1c1f2e6b96c064.
Previous, reverted attempt:
acda2cc90aea519f41c8ae55bc4d05f02072df84.
Bug: T97709
Change-Id: I94a0c7c20f78c31149685c4443564be240ddad50
Translation updater bot [Mon, 20 Aug 2018 19:55:37 +0000 (21:55 +0200)]
Localisation updates from https://translatewiki.net.
Change-Id: Ifab1146f977f25c1714b857c12ef279aba164650
Timo Tijhof [Mon, 20 Aug 2018 19:19:24 +0000 (20:19 +0100)]
resourceloader: Remove wgResourceLoaderValidateStaticJS setting
Not used since 2011 (MediaWiki 1.18).
In an early version of ResourceLoader, we ran JSMinPlus syntax
validation on-demand on all served JavaScript content. This
was identified as cause of slowdown and high memory use, and
generally not considered as useful in production.
The reason it was there originally was not for the purpose of
validating static files, but for user-generated content.
So in MediaWiki 1.18, the behaviour of wgResourceLoaderValidateJS
was changed to only apply to user-generated content, and the
rest was disabled behind wgResourceLoaderValidateStaticJS, which
we then never use. Not even in development, given that we now
have superior experience through ESLint, even within IDEs where
supported.
Follows-up
49d3d18033738 (r91914).
Change-Id: Ie25109a4fb23ee93fed0db4af5db4b11fe9ffe7f
jenkins-bot [Mon, 20 Aug 2018 18:32:06 +0000 (18:32 +0000)]
Merge "resourceloader: Merge the two ua.match() calls in startup.js"
Gergő Tisza [Wed, 11 Jul 2018 09:24:07 +0000 (11:24 +0200)]
[MCR] Render multi-slot diffs
Move logic for rendering a diff between two content objects out of
DifferenceEngine, into a new SlotDiffRenderer class. Make
DifferenceEngine use multiple SlotDiffRenderers, one per slot.
This separates the class tree for changing high-level diff properties
such as the header or the revision selection method (same as before:
subclass DifferenceEngine and override ContentHandler::getDiffEngineClass
or implement GetDifferenceEngine) and the one for changing the actual
diff rendering for a given content type (subclass SlotDiffRenderer and
override ContentHandler::getSlotDiffRenderer or implement
GetSlotDiffRenderer). To keep B/C, when SlotDiffRenderer is not overridden
for a given content type but DifferenceEngine is, that DifferenceEngine
will be used instead.
The weak point of the scheme is overriding the DifferenceEngine methods
passing control to the SlotDiffRenderers (the ones calling
getDifferenceEngines), without calling the parent. These are:
showDiffStyle, getDiffBody, getDiffBodyCacheKeyParams. Extensions doing
that will probably break in unpredictable ways (most likely, only
showing the main slot diff). Nothing in gerrit does it, at least.
A new GetSlotDiffRenderer hook is added to modify rendering for content
models not owned by the extension, much like how GetDifferenceEngine
works.
Also deprecates public access to mNewRev/mOldRev and creates public
getters instead. DifferenceEngine never supported external changes to
those properties, this just acknowledges it.
Bug: T194731
Change-Id: I2f8a9dbebd2290b7feafb20e2bb2a2693e18ba11
Depends-On: I04e885a33bfce5bccc807b9bcfe1eaa577a9fd47
Depends-On: I203d8895bf436b7fee53fe4718dede8a3b1768bc
Gergő Tisza [Mon, 13 Aug 2018 16:53:59 +0000 (18:53 +0200)]
Create DifferenceEngine before calling GetDifferenceEngine
This way the hook is able to consider what kind of DifferenceEngine
was created by default, or even wrap/decorate it.
Change-Id: Ibb6b1b087a2dda445be2b5e8c7518c7d169b5192
Kunal Mehta [Mon, 20 Aug 2018 07:21:49 +0000 (00:21 -0700)]
benchmarker: Implement setupEach for per-iteration setup
To bypass caches in legacy code where injection doesn't easily work,
support a per-iteration setup function, 'setupEach', which runs right
before the actual function is timed and called.
And use it in benchmarkTitleValue, where I mistakenly assumed that
'setup' did what I wanted.
Bug: T201992
Change-Id: I2d01d899bf63576df2833705667f1a16604ab4cc
Timo Tijhof [Mon, 20 Aug 2018 05:11:17 +0000 (06:11 +0100)]
resourceloader: Merge the two ua.match() calls in startup.js
Covered by tests. No need for the separate //i regex.
Change-Id: I2fb5c8f45a3b9d9d20884c58d1adbd9e6cee2814
Kunal Mehta [Mon, 20 Aug 2018 04:46:21 +0000 (21:46 -0700)]
Support a heading of '0' in Html::messageBox()
Change-Id: I181cb6f92ab1b10d87b1213a043a5f291149d094
jenkins-bot [Mon, 20 Aug 2018 01:35:01 +0000 (01:35 +0000)]
Merge "Simplify redirect linking in InfoAction"
Translation updater bot [Sun, 19 Aug 2018 19:53:50 +0000 (21:53 +0200)]
Localisation updates from https://translatewiki.net.
Change-Id: I0a824a0c317de91546f123d42158f818113f63b0
jenkins-bot [Sun, 19 Aug 2018 17:07:13 +0000 (17:07 +0000)]
Merge "Improve StaticArrayWriterTest and add missing @covers tag"
jenkins-bot [Sun, 19 Aug 2018 07:51:39 +0000 (07:51 +0000)]
Merge "Create and use PrefixingStatsdDataFactoryProxy in PerDbNameStatsdDataFactory"
jenkins-bot [Sun, 19 Aug 2018 07:40:05 +0000 (07:40 +0000)]
Merge "CSP: In tests, use setMwGlobals() instead of manual set+undo"
addshore [Sat, 18 Aug 2018 10:22:38 +0000 (11:22 +0100)]
Create and use PrefixingStatsdDataFactoryProxy in PerDbNameStatsdDataFactory
MediaWiki::emitBufferedStatsdData() is never called for the PerDbName factory,
so stats were being dropped. Instead of having two factories, turn the
PerDbName one into a proxy/wrapper around the main factory that just adds a
prefix in front of all of the keys.
Bug: T202144
Change-Id: I31e376446abb58e41353b4ca3814120d2e914104
Kunal Mehta [Sun, 19 Aug 2018 07:06:35 +0000 (00:06 -0700)]
Improve StaticArrayWriterTest and add missing @covers tag
Checking for proper quoting was suggested by Krinkle in CR.
Change-Id: I7fa599767017a5cfc82899bc4178de6cb34bdd02
Timo Tijhof [Sun, 19 Aug 2018 00:42:58 +0000 (01:42 +0100)]
CSP: In tests, use setMwGlobals() instead of manual set+undo
This is the idiom as used in other PHPUnit tests for MediaWiki.
Change-Id: I285e5abe57bad8b9a8a3b35d81bb3a9f5f3dbe85
Translation updater bot [Sat, 18 Aug 2018 19:53:37 +0000 (21:53 +0200)]
Localisation updates from https://translatewiki.net.
Change-Id: Ia8ac63807e9d30d524349ab38e4c66f3f840ce57
Kunal Mehta [Sat, 18 Aug 2018 05:32:19 +0000 (22:32 -0700)]
Remove wfMakeStaticArrayFile()
Replaced by the StaticArrayWriter class.
Bug: T200626
Change-Id: I7c02cf3a7dda2804d2eb8d51716254bd78b7544c
Kunal Mehta [Sat, 18 Aug 2018 05:31:36 +0000 (22:31 -0700)]
Move wfMakeStaticArrayFile() into a class
And include tests :)
This code is independent of MediaWiki, but not really large enough to be
worth librarizing right now.
Bug: T200626
Change-Id: I022c074e8a708fb5219bc4ff4b53e7e31f60dc4b
jenkins-bot [Sat, 18 Aug 2018 05:03:47 +0000 (05:03 +0000)]
Merge "Reduce calls to MediaWikiServices::getInstance()"
jenkins-bot [Sat, 18 Aug 2018 04:10:00 +0000 (04:10 +0000)]
Merge "Use Title::makeName in Special:Export to simplify code"
Umherirrender [Sat, 18 Aug 2018 04:02:39 +0000 (06:02 +0200)]
Reduce calls to MediaWikiServices::getInstance()
In some functions MediaWikiServices::getInstance() was called twices or
in loops. Extract the variable to reduce calls.
Change-Id: I2705db11d7a9ea73efb9b5a5c40747ab0b3ea36f
Timo Tijhof [Sat, 18 Aug 2018 03:29:53 +0000 (04:29 +0100)]
benchmarks: Minor cleanup for strtr benchmark
Only bench with variable input ("indirect"). The static string is
too unrealistic and not worth testing for imho, if it even makes
a difference at all.
Also bump the default count from 100 to 10,000 given it's so tiny.
Change-Id: Iccc35af4bd3c5b0967983ddfacd1d4ead235e4a4
Umherirrender [Sat, 18 Aug 2018 03:10:24 +0000 (05:10 +0200)]
Use Title::makeName in Special:Export to simplify code
Also adjust param docs
Change-Id: Ia938b38c86da25e73b91a55506d660bc9ca9384f
jenkins-bot [Sat, 18 Aug 2018 01:18:38 +0000 (01:18 +0000)]
Merge "TitleFormatter: Remove indirection from getText()"
jenkins-bot [Sat, 18 Aug 2018 01:14:51 +0000 (01:14 +0000)]
Merge "TitleFormatter: Don't look up namespace name for ns 0"
jenkins-bot [Sat, 18 Aug 2018 01:05:28 +0000 (01:05 +0000)]
Merge "TitleValue: Avoid function call for internal property"
jenkins-bot [Sat, 18 Aug 2018 01:04:31 +0000 (01:04 +0000)]
Merge "test: Assert that API generators have unique prefixes"
jenkins-bot [Sat, 18 Aug 2018 00:55:18 +0000 (00:55 +0000)]
Merge "Turn ApiPrefixUniquenessTest into a structure test"
Kunal Mehta [Sat, 18 Aug 2018 00:26:26 +0000 (17:26 -0700)]
Optimize TitleFormatter::getPrefixedText() to Title performance
...by instance caching the result on the LinkTarget object.
Title::getPrefixedText() is an extremely hot function that has been
fully optimized over the years due to its usage basically everywhere in
MediaWiki.
Apply the same treatment to TitleFormatter, but keep the caching as part
of the LinkTarget instance so we can share caches across Title and
TitleFormatter. Once Title is switched over to using TitleFormatter
internally, we can probably centralize the cache again, and get rid of
the public but marked @private member variables.
Bug: T201801
Change-Id: I4ae2d6b176f69f66720473aeae85e39a601a9781
Kunal Mehta [Sat, 18 Aug 2018 00:09:26 +0000 (17:09 -0700)]
TitleFormatter: Implement
fbc144965315 and unify prefix logic
fbc144965315 (Make Titles with an unknown namespace ID refer to
Special:Badtitle.) was never implemented in TitleFormatter, so let's do
that.
While we're at it, formatTitle() is now structured in the same format as
Title::prefix(), to make it easier to compare code between the two
implementations. The existing tests verify that this is a no-op. There's
a little extra indirection in getPrefixedDBkey(), which now goes through
dbkeyform -> textform -> dbkeyform, but reduces duplication of code,
which I think is worth it.
Bug: T165149
Change-Id: I4e43487a52663d2a647f9e71d487f58e25474f7a
Antoine Musso [Tue, 19 Jun 2018 07:50:12 +0000 (09:50 +0200)]
test: Assert that API generators have unique prefixes
Signed-off-by: Brad Jorsch <bjorsch@wikimedia.org>
Change-Id: I30758f2ac95fd8ae361ef8079abdfb0a82d92e34
Kunal Mehta [Fri, 17 Aug 2018 23:41:02 +0000 (16:41 -0700)]
TitleFormatter: Remove indirection from getText()
At the end of the day, the output is identical to LinkTarget::getText().
Change-Id: Ifddafb79d7602ba5e368cc40f99c56e22a56d506