summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorMichael Foster <savetheinternet@tinyboard.org>2013-08-22 03:35:57 +1000
committerMichael Foster <savetheinternet@tinyboard.org>2013-08-22 03:35:57 +1000
commit5cc7bd860fe653db831b20c7937a80ef35221f56 (patch)
treec85f7137a48c4fd8f6764b587afd06114fed6ec7 /inc
parenta65c4f2c1fa81073f380ad42b8073720de02fee2 (diff)
Add cache and gm to pre-installation test. Don't die when we can't write to templates/cache.
Diffstat (limited to 'inc')
-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());