/**
  * Create new Instance of Cache
  * @param Config $config Configuration
  */
 public function __construct(Config $config)
 {
     $this->setEnabled($config->getCache());
     if ($this->getEnabled()) {
         $this->setDir($config->getCacheDir());
         $this->setTtl($config->getTtl());
     }
 }
 function refreshCacheDir()
 {
     $dirTmp = Site::racine() . Config::getCacheDir() . 'Smarty/' . $this->templateName . '/';
     if (!is_dir($dirTmp)) {
         if (!mkdir($dirTmp, 0777, true)) {
             Site::error('Impossible de creer le dossier de cache : ' . $dirTmp);
             return false;
         }
     }
     $this->cache_dir = $dirTmp;
     return true;
 }