public function loadPath($path)
 {
     $dir = Tools::cleanScandir($path);
     foreach ($dir as &$f) {
         if (is_file($path . DS . $f)) {
             $this->loadFile($path . DS . $f);
         }
     }
 }
 public function purgeLogsDir($deleteRootLogsDir = true)
 {
     $dir = Tools::cleanScandir(self::$_logDir);
     foreach ($dir as &$f) {
         if (is_file(self::$_logDir . $f)) {
             unlink(self::$_logDir . $f);
         }
         if (is_dir(self::$_logDir . $f)) {
             Tools::deleteTreeDirectory(self::$_logDir . $f);
         }
     }
     if ($deleteRootLogsDir) {
         chmod(self::$_logDir, 0775);
         rmdir(self::$_logDir);
     }
 }
 public function minify($returnContent = true, $forceCacheUpdate = false)
 {
     // autoloading files
     foreach (Tools::cleanScandir($this->getPath()) as $file) {
         if (Validate::isFileExtension($this->_type, $file)) {
             $this->addFile($this->getPath() . $file);
         }
     }
     $this->_key = md5($this->_name . Router::getHost(true, Http::isHttps()) . $this->getPath());
     if ($this->_cacheExpired() || $forceCacheUpdate) {
         $this->_generateCache();
     }
     if ($returnContent) {
         return $this->getContent();
     }
 }
 public function purge($deleteCachePath = true, $chmod = false)
 {
     $dir = Tools::cleanScandir($this->_path);
     foreach ($dir as &$f) {
         if (is_file($this->_path . $f)) {
             unlink($this->_path . $f);
         }
         if (is_dir($this->_path . $f)) {
             Tools::deleteTreeDirectory($this->_path . $f, true, $chmod);
         }
     }
     if ($deleteCachePath) {
         chmod($this->_path, $chmod);
         rmdir($this->_path);
     }
     Logger::getInstance()->debug('Cache purged', 'cache' . $this->_name);
 }