resource = $zip->open( $file ); if ($this->resource === FALSE) throw new \Exception("Failed opening zip file"); } public function extractTo( $destination){ $this->resource->extractTo($destination); for ($i = 0; $i < $this->resource->numFiles; $i++) { $filename = $this->resource->getNameIndex($i); $this->setExtractedFiles($filename, pathinfo($filename, PATHINFO_EXTENSION)); } $this->resource->close(); } public static function getExtension(){ return 'rar'; } }