From dcf2cdf0732da984d055cb2808ea0502524430d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdulrahman=20=E2=98=95=EF=B8=8F?= Date: Wed, 12 Dec 2018 21:59:07 +0300 Subject: [PATCH] Update style.php refactoring --- includes/style.php | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/includes/style.php b/includes/style.php index 1f39ea5..dfae390 100755 --- a/includes/style.php +++ b/includes/style.php @@ -20,22 +20,19 @@ 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 + + + /** + * check if caching is not enabled and empty style cache files */ - function __wakeup() + public 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) - { - delete_cache($file); - } - } + if(! $this->caching) + { + delete_cache(null, true); + } } + /** * Function to load a template file. * @param $template_name