Changes from patch set Icb93c79f4843b59dae80d3eda1a880457a1a68f2
Also some swaps from assertEquals to assertSame/True/False/Null
Change-Id: Ife497ae6cb1888b77eb25e85b76df72adc65641a
This patch covers the following changes to the MessagesBs.php file:
* Updates: Correct typos currently present in the file
* Standardization: Use a consistent alias format and allow aliases with and without underscores
* Consistency: Use existing TranslateWiki strings to prioritize certain aliases
Bug: T288033
Change-Id: I8f3df0069b7482ad570fed8450785280d022db72
The difference is that previously we used microtime(), which provides a
float, and now time() is used, which provides an int, but there is no
difference for the comparison.
Change-Id: If1463e0fc2a2526ab4d2af64830b73ae3bf330f6
Use the already provided content language to get the language converter
for the content language
Bug: T252095
Change-Id: I2bc085d5ca8ce2570e6da21128ea785799c958e5
Replace deprecated Language::convertNamespace
Necessary services in SpecialSearch already injected
Explicit pass content language to existing call to make different more
visible between both calls
Bug: T252095
Change-Id: I4d4bd6e1246e57d952b73cb99a4a129028d7ff5b
I10d2b32bd95316e1331b5eb88ef57de55c3ca1a1 removed the last usage of MediaWikiTestCaseTrait, thus the use statement can be removed.
Change-Id: I05b3b56abc8079abd294e453c78128858ef8ea7d
Changed interface back to real class for private
getHumanTimestampInternal, an user object is always passed,
because the user object is needed for the hook
Change-Id: I88a4915a875bd85173d86fc5da27d0d1a32bceff
Two enhancements:
1. If the status code of the mocked response is >= 400,
the Status object returned by the mock request should actually
be fatal, not good.
2. Convenience method to create a mock request that will
result in a timeout response, compatible with real timeout.
Change-Id: I4c3aab6ab88695729b4f398dacf3575fbdb4dad4
This patch includes:
* Format standardization of aliases. The format with underscores is more comprehensible and readable to speakers of the Serbian variety.
* Minor language correction for Serbian Cyrillic ("API_песак" -> "Песак_API-ја") and harmonization with the corresponding translations on translatewiki.net ("ОбрисаниДоприноси" -> "Избрисани_доприноси").
* Adding Latin aliases. Until today, there were no Latin aliases for special pages. This made it difficult to link and find them.
Bug: T185421
Change-Id: Ibbd1859ecc98fcb3330039badf30a079aa418ae5
* Pass perfLogger through from LBFactory to LoadBalancer. Previously it
was always NullLogger.
* Use it to log the calculated pending write query duration so that we
can monitor how close it was to throwing an exception.
Bug: T287859
Change-Id: I6865baeee993e9254455de904f40d2d1abaffa4d
* Use isset() instead of in_array()
In dropDefaults():
* Remove strtolower(), since the performance cost of running
strtolower() on all attribute names far outweighs the performance
benefit of dropping default values for attributes with non-canonical
capitalisation. Attribute names with non-canonical case are extremely
rare in the MediaWiki ecosystem. The change is harmless in the sense
that a default attribute is semantically equivalent to an omitted
attribute.
* Handle common cases first.
* Avoid value normalization when the attribute name is unknown.
* For class attributes, check if the value is empty using strict
comparison rather than normalization.
In expandAttributes():
* If the value is an array, explode each element and add the parts to
an array rather than doing implode() then explode().
* If the value is an array, check for spaces in the loop rather than
calling array_diff().
* Replace $quote with a literal
* Skip the check for boolean attributes if we already know it is a
space-separated attribute.
* Inline Sanitizer::encodeAttribute
Measuring instruction count per iteration with perf stat, averaged over
10M iterations, PS1. Test case:
Html::openElement('a', [ 'class' => [ 'foo', 'bar' ] ] )
* Baseline: 11160.7265433
* in_array(): 10390.3837233
* dropDefaults() changes: 9674.1248824
* expandAttributes() misc: 9248.1947500
* implode/explode and space check: 8318.9800417
* Sanitizer inline: 8021.7371794
Change-Id: I7680b8939da50430316d77d42ebc1987752e99dc