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 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); }