/**
  * Returns entry content
  *
  * @param   io.archive.zip.ZipEntry entry
  * @return  string
  */
 protected function entryContent(\io\archive\zip\ZipEntry $entry)
 {
     if ($entry->isDirectory()) {
         return null;
     } else {
         return (string) Streams::readAll($entry->getInputStream());
     }
 }
Ejemplo n.º 2
0
 /**
  * Returns entry content; or NULL for directories
  *
  * @param   io.archive.zip.ZipEntry $entry
  * @return  string
  */
 protected function entryContent(ZipEntry $entry)
 {
     if ($entry->isDirectory()) {
         return null;
     } else {
         return (string) Streams::readAll($entry->in());
     }
 }
Ejemplo n.º 3
0
 /**
  * Adds an entry
  *
  * @param   io.archive.zip.ZipEntry entry
  * @return  io.archive.zip.ZipEntry entry
  * @throws  lang.IllegalArgumentException in case the filename is longer than 65535 bytes
  */
 public function add(ZipEntry $entry)
 {
     if ($entry->isDirectory()) {
         return $this->addDir($entry);
     } else {
         return $this->addFile($entry);
     }
 }