Enable recursive partials in TemplateParser
authorGergő Tisza <tgr.huwiki@gmail.com>
Sun, 10 Sep 2017 03:08:43 +0000 (20:08 -0700)
committerGergő Tisza <gtisza@wikimedia.org>
Sun, 10 Sep 2017 05:51:07 +0000 (05:51 +0000)
commit49350108bf5f7b4beface0a873cbacadec5f01a2
treea2514bed89a7b2440b0dacea8467eee2808f92e2
parent56ade0650d492e01d2689dc918e7db3d56d18147
Enable recursive partials in TemplateParser

Recursive partials are the only way to handle tree-like structures
such as nested lists. Allow setting FLAG_RUNTIMEPARTIAL in LightnCandy
so they can be used.

Since this has a slight performance impact (makes partial invocations
evaluation-time functions calls instead of compilation-time transclusions)
make it optional.

Change-Id: Ie37105a9f1ff92e1a79bfcd9f8578965e3d347f0
includes/TemplateParser.php
tests/phpunit/data/templates/recurse.mustache [new file with mode: 0644]
tests/phpunit/includes/TemplateParserTest.php