Creating a new directory for Twig cache archive/twig see #4635

skala
Julio Montoya 14 years ago
parent d497f37a2d
commit aa06716b25
  1. 10
      main/inc/lib/template.lib.php

@ -42,9 +42,15 @@ class Template {
$template_paths = array(
api_get_path(SYS_CODE_PATH).'template', //template folder
api_get_path(SYS_PLUGIN_PATH) //plugin folder
api_get_path(SYS_PLUGIN_PATH) //plugin folder
);
$cache_folder = api_get_path(SYS_ARCHIVE_PATH).'twig';
if (!is_dir($cache_folder)) {
mkdir($cache_folder, api_get_permissions_for_new_directories());
}
$loader = new Twig_Loader_Filesystem($template_paths);
//Setting Twig options depending on the server see http://twig.sensiolabs.org/doc/api.html#environment-options
@ -59,7 +65,7 @@ class Template {
);
} else {
$options = array (
'cache' => api_get_path(SYS_ARCHIVE_PATH), //path to the cache folder
'cache' => $cache_folder, //path to the cache folder
'autoescape' => false,
'debug' => false,
'auto_reload' => false,

Loading…
Cancel
Save