Add cache and gm to pre-installation test. Don't die when we can't write to templates/cache.

This commit is contained in:
Michael Foster 2013-08-22 03:35:57 +10:00
parent a65c4f2c1f
commit 5cc7bd860f
2 changed files with 25 additions and 2 deletions

View file

@ -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());