1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2025-02-21 04:59:49 +01:00

New option: $config[twig_cache]

This commit is contained in:
8chan 2015-03-11 18:22:42 -07:00
parent bebd364a59
commit a97b08db42
3 changed files with 6 additions and 1 deletions

View File

@ -1715,3 +1715,6 @@
// Use oekaki?
$config['oekaki'] = false;
// Twig cache?
$config['twig_cache'] = false;

View File

@ -213,8 +213,10 @@ $config['show_sages'] = false;
$config['katex'] = false;
$config['enable_antibot'] = false;
$config['spam']['unicode'] = false;
$config['twig_cache'] = true;
// 8chan specific mod pages
require '8chan-mod-pages.php';
// Load database credentials
require "secrets.php";

View File

@ -23,7 +23,7 @@ function load_twig() {
$loader->setPaths($config['dir']['template']);
$twig = new Twig_Environment($loader, array(
'autoescape' => false,
'cache' => is_writable('templates') || (is_dir('templates/cache') && is_writable('templates/cache')) ?
'cache' => (is_writable('templates') || (is_dir('templates/cache') && is_writable('templates/cache'))) && $config['twig_cache'] ?
"{$config['dir']['template']}/cache" : false,
'debug' => $config['debug']
));