/** * Parses a haml file and returns the compile result. * * @param string $fileName */ public function parseFile($fileName) { if ($this->_cacheEnabled) { if ($this->_storage === null) { throw new Exception('Storage not set'); } $fileId = $this->_storage->generateContentId($fileName); if ($this->isCacheEnabled() && $this->_storage->isFresh($fileId, $fileName)) { return $this->_storage->fetch($fileId); } // file is not fresh, so compile and cache it $this->_storage->cache($fileId, $this->_compiler->parseFile($fileName)); return $this->_storage->fetch($fileId); } // not using cache return $this->_compiler->parseFile($fileName); }