The Twig engine provides options for configuring debugging, automatic reloading (recompiling) of templates, and caching compiled templates in the filesystem. The core implementation of Twig supports these options but they are currently hardcoded and cannot be overridden by developers. These are the defaults in core:
Enabling debug should also implicitly enable auto_reload unless auto_reload is set to FALSE. Having auto_reload default to NULL is Twig's default behaviour and would make more sense to folks who are already familiar with Twig.
Originally a UI solution was proposed, but since these settings are used by developers and will likely be different per environment, settings.php configuration was determined to be a better solution.
The patch adds three new settings (twig_debug, twig_auto_reload, twig_cache) to settings.php to control these Twig environment options and uses the Settings API to access this information when building the Twig environment.
The proposed patch also makes auto_reload match Twig's implementation and documentation, so that enabling debug also enables auto_reload unless a value is specified for auto_reload.
Review the latest patch.
User interface changes
Original report by japerry
in TwigFactory.php , autoreload is hardcoded to TRUE. We should be listening to the performance settings page instead.
PASSED: [[SimpleTest]]: [MySQL] 53,830 pass(es). View
PASSED: [[SimpleTest]]: [MySQL] 50,532 pass(es). View
PASSED: [[SimpleTest]]: [MySQL] 50,576 pass(es). View