resource = rar_open( $file, $password ); if ($this->resource === FALSE) throw new \Exception("Failed opening rar file"); } public function extractTo( $destination){ $list = rar_list($this->resource); foreach($list as $file) { $entry = rar_entry_get($this->resource, $file); $entry->extract($destination); $this->setExtractedFiles($entry->getName(), pathinfo($entry->getName(), PATHINFO_EXTENSION)); } rar_close($this->resource); } public static function getExtension(){ return 'rar'; } }