/** * Destructor */ public function __destruct() { if ($this->_archive !== null) { $this->_archive->close(); } }
private function Unrar($filepath, $location) { $rar = new RarArchive(); $res = $rar->open($filepath); if ($res === TRUE) { $entries = $rar->getEntries(); foreach ($entries as $entry) { $entry->extract($location); } $rar->close(); return true; } throw new Exception('rarfailed'); }