protected function PackItems($results) { // We got all d/l try { // We are done! Create a ZIP file $zip = new \ZipArchive(); $output = $this->lmv->extractDir("/{$this->identifier}.zip"); $zip->open($output, \ZipArchive::CREATE); $zip->addEmptyDir($this->identifier); $path = $this->lmv->dataDir("/{$this->identifier}"); $finder = new Finder(); $finder->files()->in($path); foreach ($finder as $file) { $zpath = utils::postStr('/data/', utils::normalize($file->getRealpath())); $zip->addFile($file->getRealpath(), $zpath); } $zip->close(); utils::log('PackItems ended successfully.'); } catch (Exception $err) { utils::log('PackItems exception'); throw $err; } }