/** * Returns an array of entries in a given zip file * * @param io.archive.zip.ZipArchiveReader reader * @return [:string] content */ protected function entriesWithContentIn(ZipArchiveReader $zip) { $entries = array(); foreach ($zip->entries() as $entry) { $entries[$entry->getName()] = $this->entryContent($entry); } return $entries; }
/** * Returns an array of entries in a given zip file * * @param io.archive.zip.ZipArchiveReader reader * @return io.archive.zip.ZipEntry[] */ protected function entriesIn(ZipArchiveReader $zip) { $entries = array(); foreach ($zip->entries() as $entry) { $entries[] = $entry; } return $entries; }
/** * Returns an array of entries in a given zip file * * @param io.archive.zip.ZipArchiveReader reader * @return [:string] content */ protected function entriesWithContentIn(ZipArchiveReader $zip) { $entries = array(); for ($it = $zip->iterator(); $it->hasNext();) { $entry = $it->next(); $entries[$entry->getName()] = $this->entryContent($entry); } return $entries; }
public function close() { $stream = newinstance('io.streams.InputStream', array(), '{ public $closed= FALSE; public function read($limit= 8192) { return ""; } public function available() { return 0; } public function close() { $this->closed= TRUE; } }'); $reader = new ZipArchiveReader($stream); $reader->close(); $this->assertTrue($stream->closed); }