mirror of
https://github.com/kleeja-official/kleeja.git
synced 2025-12-15 04:29:42 +01:00
Update style.php
refactoring
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user