summaryrefslogtreecommitdiff
path: root/inc/template.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/template.php')
-rw-r--r--inc/template.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/inc/template.php b/inc/template.php
index 09e27c26..ef688944 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -26,7 +26,8 @@ function load_twig() {
$loader->setPaths($config['dir']['template']);
$twig = new Twig_Environment($loader, array(
'autoescape' => false,
- 'cache' => "{$config['dir']['template']}/cache",
+ 'cache' => is_writable('templates') && (!is_dir('templates/cache') || is_writable('templates/cache')) ?
+ "{$config['dir']['template']}/cache" : false,
'debug' => $config['debug']
));
$twig->addExtension(new Twig_Extensions_Extension_Tinyboard());