Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
c05b5bf5
Commit
c05b5bf5
authored
Feb 06, 2013
by
catch
Browse files
Issue
#1843034
by Cottser, japerry, heyrocker, steveoliver, c4rl: Make Twig settings configurable.
parent
05d0b5a8
Changes
2
Hide whitespace changes
Inline
Side-by-side
core/lib/Drupal/Core/CoreBundle.php
View file @
c05b5bf5
...
...
@@ -368,7 +368,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_cache'
,
TRUE
)
,
'base_template_class'
=>
'Drupal\Core\Template\TwigTemplate'
,
// @todo Remove in followup issue
// @see http://drupal.org/node/1712444.
...
...
@@ -376,10 +376,8 @@ protected function registerTwig(ContainerBuilder $container) {
// @todo Remove in followup issue
// @see http://drupal.org/node/1806538.
'strict_variables'
=>
FALSE
,
// @todo Maybe make debug mode dependent on "production mode" setting.
'debug'
=>
TRUE
,
// @todo Make auto reload mode dependent on "production mode" setting.
'auto_reload'
=>
FALSE
,
'debug'
=>
settings
()
->
get
(
'twig_debug'
,
FALSE
),
'auto_reload'
=>
settings
()
->
get
(
'twig_auto_reload'
,
NULL
),
))
->
addMethodCall
(
'addExtension'
,
array
(
new
Definition
(
'Drupal\Core\Template\TwigExtension'
)))
// @todo Figure out what to do about debugging functions.
...
...
sites/default/default.settings.php
View file @
c05b5bf5
...
...
@@ -283,6 +283,42 @@
*/
$settings
[
'update_free_access'
]
=
FALSE
;
/**
* Twig debugging:
*
* When enabled, you can use the 'dump' function in Twig templates to output
* information about variables, and templates are automatically recompiled
* whenever the source code changes.
*
* @see http://drupal.org/node/1906392
*
* Not recommended in production environments (Default: FALSE).
*/
# $settings['twig_debug'] = TRUE;
/**
* Twig auto-reload:
*
* Automatically recompile Twig templates whenever the source code changes. If
* you don't provide a value for twig_auto_reload, it will be determined based
* on the value of twig_debug.
*
* Not recommended in production environments (Default: NULL).
*/
# $settings['twig_auto_reload'] = TRUE;
/**
* Twig cache:
*
* By default, Twig templates will be compiled and stored in the filesystem to
* increase performance. Disabling the Twig cache will recompile the templates
* from source each time they are used. In most cases the twig_auto_reload
* setting above should be enabled rather than disabling the Twig cache.
*
* Not recommended in production environments (Default: TRUE).
*/
# $settings['twig_cache'] = FALSE;
/**
* External access proxy settings:
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment