From 7e496094e0c61483a8b5579285e99d8942058b02 Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Fri, 24 Feb 2017 11:00:04 +0000 Subject: [PATCH] fall back to sys_get_temp_dir() if we cannot write to a templates_c like place --- smarty.inc.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/smarty.inc.php b/smarty.inc.php index a2c1632c..f6ff7ad0 100644 --- a/smarty.inc.php +++ b/smarty.inc.php @@ -20,6 +20,11 @@ class PFASmarty { if(is_dir($templates_c) && is_writeable($templates_c)) { $this->template->setCompileDir($templates_c); } + else { + $this->template->compile_check = false; + $this->template->caching = false; + $this->template->setCompileDir(sys_get_temp_dir()); + } $this->template->setConfigDir(dirname(__FILE__) . '/configs'); }