From 11b8770abf34250aebbc83438939ba9b7fd687fd Mon Sep 17 00:00:00 2001 From: munjoob <35959208+munjoob@users.noreply.github.com> Date: Wed, 12 Dec 2018 18:03:39 +0000 Subject: [PATCH] Update style.php check if caching is not enabled and empty style cache files only to keep kleeja log file for development needs instead of emptying all cache folder from cp. --- includes/style.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/includes/style.php b/includes/style.php index a35e59a..01b2806 100755 --- a/includes/style.php +++ b/includes/style.php @@ -20,7 +20,22 @@ class kleeja_style protected $loop = array(); protected $reg = array('var' => '/([{]{1,2})+([A-Z0-9_\.]+)[}]{1,2}/i'); public $caching = true; #save templates as caches to not compiled a lot of times - + public $cache_folder=PATH . 'cache'; + public $cache_ext='.php'; + /** + * check if caching is not enabled and empty style cache files + */ + function __wakeup() + { + if(!$this->caching) + { + $files = glob($this->cache_folder."/*".$cache_ext); //get all files ended with style caches file extention + foreach ($files as $file) + { + unlink($file); + } + } + } /** * Function to load a template file. * @param $template_name