|
@@ -42,13 +42,28 @@ class Template {
|
|
|
|
|
|
$loader = new Twig_Loader_Filesystem($template_paths);
|
|
|
|
|
|
- $this->twig = new Twig_Environment($loader, array(
|
|
|
-
|
|
|
- 'autoescape' => false,
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- ));
|
|
|
+
|
|
|
+ if (api_get_setting('server_type') == 'test') {
|
|
|
+ $options = array (
|
|
|
+
|
|
|
+ 'autoescape' => false,
|
|
|
+ 'debug' => true,
|
|
|
+ 'auto_reload' => true,
|
|
|
+ 'optimizations' => 0,
|
|
|
+ 'strict_variables' => true,
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ $options = array (
|
|
|
+ 'cache' => api_get_path(SYS_ARCHIVE_PATH),
|
|
|
+ 'autoescape' => false,
|
|
|
+ 'debug' => false,
|
|
|
+ 'auto_reload' => false,
|
|
|
+ 'optimizations' => -1,
|
|
|
+ 'strict_variables' => false
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ $this->twig = new Twig_Environment($loader, $options);
|
|
|
|
|
|
$this->twig->addFilter('get_lang', new Twig_Filter_Function('get_lang'));
|
|
|
$this->twig->addFilter('get_path', new Twig_Filter_Function('api_get_path'));
|