diff --git a/core/lib/Drupal/Core/CoreBundle.php b/core/lib/Drupal/Core/CoreBundle.php index 624c716..9a94d08 100644 --- a/core/lib/Drupal/Core/CoreBundle.php +++ b/core/lib/Drupal/Core/CoreBundle.php @@ -342,7 +342,7 @@ protected function registerTwig(ContainerBuilder $container) { // This is saved / loaded via drupal_php_storage(). // All files can be refreshed by clearing caches. // @todo ensure garbage collection of expired files. - 'cache' => TRUE, + 'cache' => settings()->get('twig_debugging', FALSE), 'base_template_class' => 'Drupal\Core\Template\TwigTemplate', // @todo Remove in followup issue // @see http://drupal.org/node/1712444. @@ -351,9 +351,9 @@ protected function registerTwig(ContainerBuilder $container) { // @see http://drupal.org/node/1806538. 'strict_variables' => FALSE, // @todo Maybe make debug mode dependent on "production mode" setting. - 'debug' => TRUE, + 'debug' => settings()->get('twig_debugging', FALSE), // @todo Make auto reload mode dependent on "production mode" setting. - 'auto_reload' => FALSE, + 'auto_reload' => settings()->get('twig_autorefresh_templates', FALSE), )) ->addMethodCall('addExtension', array(new Definition('Drupal\Core\Template\TwigExtension'))) // @todo Figure out what to do about debugging functions. diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php index 8dbb5a7..3abecbc 100644 --- a/sites/default/default.settings.php +++ b/sites/default/default.settings.php @@ -284,6 +284,29 @@ $settings['update_free_access'] = FALSE; /** + * Debugging information flag for Twig. + * + * Setting this to TRUE will provide additional debug information which is + * useful for Twig development. Note: This is not recommended for use on + * production websites. + */ +$settings['twig_debugging'] = FALSE; + +/** + * Verbose debugging information flag for Twig. + * + * Same as the above but with more verbose output. + */ +$settings['twig_verbose_debugging'] = FALSE; + +/** + * Autorefresh Twig templates. + * + * Automatically refresh Twig templates whenever the source code changes. + */ +$settings['twig_autorefresh_templates'] = FALSE; + +/** * External access proxy settings: * * If your site must access the Internet via a web proxy then you can enter