src/Zip.php
protected function extractNative($archive, $destination)
	{
		$zip = zip_open($archive);

		if (!\is_resource($zip))
		{
			throw new \RuntimeException('Unable to open archive');
		}

		// Make sure the destination folder exists
		if (!Folder::create($destination))
		{
			throw new \RuntimeException('Unable to create destination folder ' . \dirname($path));
		}

		// Read files in the archive
		while ($file = @zip_read($zip))
		{
			if (!zip_entry_open($zip, $file, 'r'))
			{
				throw new \RuntimeException('Unable to read ZIP entry');
			}

			if (substr(zip_entry_name($file), \strlen(zip_entry_name($file)) - 1) != '/')
			{
				$buffer = zip_entry_read($file, zip_entry_filesize($file));

				if (File::write($destination . '/' . zip_entry_name($file), $buffer) === false)
				{
					throw new \RuntimeException('Unable to write ZIP entry to file ' . $destination . '/' . zip_entry_name($file));
				}

				zip_entry_close($file);
			}
		}

		@zip_close($zip);

		return true;
	}
protected function extractNative($archive, $destination)
	{
		$zip = zip_open($archive);

		if (!\is_resource($zip))
		{
			throw new \RuntimeException('Unable to open archive');
		}

		// Make sure the destination folder exists
		if (!Folder::create($destination))
		{
			throw new \RuntimeException('Unable to create destination folder ' . \dirname($path));
		}

		// Read files in the archive
		while ($file = @zip_read($zip))
		{
			if (!zip_entry_open($zip, $file, 'r'))
			{
				throw new \RuntimeException('Unable to read ZIP entry');
			}

			if (substr(zip_entry_name($file), \strlen(zip_entry_name($file)) - 1) != '/')
			{
				$buffer = zip_entry_read($file, zip_entry_filesize($file));

				if (File::write($destination . '/' . zip_entry_name($file), $buffer) === false)
				{
					throw new \RuntimeException('Unable to write ZIP entry to file ' . $destination . '/' . zip_entry_name($file));
				}

				zip_entry_close($file);
			}
		}

		@zip_close($zip);

		return true;
	}
protected function extractNative ( $ archive , $ destination ) { $ zip = zip_open ( $ archive ) ; if ( ! \ is_resource ( $ zip ) ) { throw new \ RuntimeException ( 'Unable to open archive' ) ; } // Make sure the destination folder exists if ( ! Folder :: create ( $ destination ) ) { throw new \ RuntimeException ( 'Unable to create destination folder ' . \ dirname ( $ path ) ) ; } // Read files in the archive while ( $ file = @ zip_read ( $ zip ) ) { if ( ! zip_entry_open ( $ zip , $ file , 'r' ) ) { throw new \ RuntimeException ( 'Unable to read ZIP entry' ) ; } if ( substr ( zip_entry_name ( $ file ) , \ strlen ( zip_entry_name ( $ file ) ) - 1 ) != '/' ) { $ buffer = zip_entry_read ( $ file , zip_entry_filesize ( $ file ) ) ; if ( File :: write ( $ destination . '/' . zip_entry_name ( $ file ) , $ buffer ) === false ) { throw new \ RuntimeException ( 'Unable to write ZIP entry to file ' . $ destination . '/' . zip_entry_name ( $ file ) ) ; } zip_entry_close ( $ file ) ; } } @ zip_close ( $ zip ) ; return true ; }
Extract a ZIP compressed file to a given path using native php api calls for speed

@param   string  $archive      Path to ZIP archive to extract
@param   string  $destination  Path to extract archive into

@return  boolean  True on success

@since   1.0
@throws  \RuntimeException
Extract a ZIP compressed file to a given path using native php api calls for speed