public function getZipFromZip($file)
    {
        $fh = $this->zip->getStream($file);
        if (false !== $fh) {
            $contents = null;
            while (!feof($fh)) {
                $contents .= fread($fh, 2);
            }
            $tmpDir = rtrim(sys_get_temp_dir(), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
            $zipFile = $tmpDir . md5($file) . time() . '.' . static::FILE_EXTENSION;
            file_put_contents($zipFile, $contents);

            $zip = new \ZipArchive();
            if (true !== $zip->open($zipFile)) {
                throw new InternalServerErrorException('Error opening zip file ' . $file . '.');
            }
            $this->destructible[] = $zipFile;

            return $zip;
        }

        return null;
    }
public function getZipFromZip($file)
    {
        $fh = $this->zip->getStream($file);
        if (false !== $fh) {
            $contents = null;
            while (!feof($fh)) {
                $contents .= fread($fh, 2);
            }
            $tmpDir = rtrim(sys_get_temp_dir(), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
            $zipFile = $tmpDir . md5($file) . time() . '.' . static::FILE_EXTENSION;
            file_put_contents($zipFile, $contents);

            $zip = new \ZipArchive();
            if (true !== $zip->open($zipFile)) {
                throw new InternalServerErrorException('Error opening zip file ' . $file . '.');
            }
            $this->destructible[] = $zipFile;

            return $zip;
        }

        return null;
    }
public function getZipFromZip ( $ file ) { $ fh = $ this -> zip -> getStream ( $ file ) ; if ( false !== $ fh ) { $ contents = null ; while ( ! feof ( $ fh ) ) { $ contents .= fread ( $ fh , 2 ) ; } $ tmpDir = rtrim ( sys_get_temp_dir ( ) , DIRECTORY_SEPARATOR ) . DIRECTORY_SEPARATOR ; $ zipFile = $ tmpDir . md5 ( $ file ) . time ( ) . '.' . static :: FILE_EXTENSION ; file_put_contents ( $ zipFile , $ contents ) ; $ zip = new \ ZipArchive ( ) ; if ( true !== $ zip -> open ( $ zipFile ) ) { throw new InternalServerErrorException ( 'Error opening zip file ' . $ file . '.' ) ; } $ this -> destructible [ ] = $ zipFile ; return $ zip ; } return null ; }
Retrieves zipped folder from ZipArchive.

@param $file

@return null|\ZipArchive
@throws \DreamFactory\Core\Exceptions\InternalServerErrorException
Retrieves zipped folder from ZipArchive .