For example, "{{#switch:x|#defaultWTF? = This is crazy}}" should not
return "This is crazy".
Bug: 67871
Change-Id: Ie3f2e6b254b9f44028156268bd8d67aa3dd1cc62
The first time we use $langObject, it's a function call with a parameter
by reference, so it needs to be unstubbed first.
Change-Id: I43cdb0a8b2728d0f69a11fd778c6a3ff03487ef3
This makes foo's equal to foo's. This is particularly important
since {{PAGENAME}} and friends html encode certain characters.
This change should be communicated to users before it hits wikis.
I don't think anyone is relying on the current behaviour, but
you never know.
Bug: 35628
Change-Id: I0035ac541d22491fcf15f55f2589aaab394ed0ed
Set the appropriate TTL when using #time or #timel. Needs I412febf3 and
I3f5a80aa in core to function.
Change-Id: I2e8b8918482b0b3f4adf154af795b6bb53b99497
Add mw.ext.ParserFunctions.expr, allowing #expr to be used without needing
to use frame:callParserFunction.
Change-Id: I64c78fafad7da503b141efb36da64c3e3d8501a5
The {{#timel:}} parser function lacks any way to output the timezone
used, and generates incorrect output for the 'c', 'r', and 'U'
formatting characters. This uses the timezone support added to core
Language::sprintfDate in Iea1f7842 to fix that.
Bug: 33454
Change-Id: I71f594132ce48140a95bd85e16183c4a1162ebef
This would make something like {{#time:H:i:s| 9:30 January 1, 2012 MST}} convert the time from 9:30 mountatin standard time to whatever it is in UTC.
I made one minor change from the patch on bugzilla in changing an @ to a wfSuppressWarnings. (The @ was already in the code, it wasn't introduced by the patch).
* When using HipHop, is_callable() returns false for objects which have only a __call() method instead of the requested one.
* Work around this by removing the ParserFunctions_HookStub hack.
* To retain the behavior that the code of ParserFunctions_body.php is only loaded when needed, turn it into a static class.
* Defer the registering of the ParserClearState hook until a relevant function is called.
* Use autoloader for ConvertParser, and ExprParser which the code was cloned from
* Fix PHP 5.1 compatibility, while there's no requirement for us to keep it, there's also no need to break it unnecessarily, and it's a really trivial fix in this case.
* Tidy whitespace
* Use ConvertDimension::getLocalisedName() for the dimensionmismatch error, as intended
[[Template:Convert]] on enwiki is a behemoth of a construction that just about manages to do this sort of conversion, taking {{convert|5|mi|km}} and outputting "5 miles (8 km)", etc. To port this to another wiki requires copying over three and a half thousand subtemplates. The additional load produced by including numerous copies of this template is measurable on large pages on enwiki, and it eats voraciously into the template limits.
This revision introduces {{#convert: 5 mi | km }}, outputting "8 km" or thereabouts. See http://www.mediawiki.org/wiki/User:Happy-melon/Convert for more details, or look at the examples in the parser tests.
In a very rough profile, comparing 50 calls to {{convert}} verses the same 50 calls to the wrapper template shown at the link above, the parser function implementation reduces page load time by 72%, preprocessor node count by 83%, post-expand include size by 86% and template argument size by 97%. More detailed profiling would probably reveal places where extra caching could improve performance further.
The primary reason for putting it in ParserFunctions instead of its own extension is availability: PFs are already available across the cluster, and it's accepted as an essential extension for any wiki wishing to emulate or mirror WMF content. One less separate extension installed on the cluster is one less extension which has to be matched by reusers.
It's still missing a lot of units, which I ran out of patience to copy from {{convert}}; I thought I'd get some feedback on the infrastructure first.