Class Zip
Class Zip
Creates or extracts Zip archives
for specs see http://www.pkware.com/appnote
- splitbrain\PHPArchive\Archive
- splitbrain\PHPArchive\Zip
Namespace: splitbrain\PHPArchive
Package: splitbrain\PHPArchive
License: MIT
Author: Andreas Gohr andi@splitbrain.org
Located at Zip.php
Package: splitbrain\PHPArchive
License: MIT
Author: Andreas Gohr andi@splitbrain.org
Located at Zip.php
public
|
#
setCompression( integer $level = 9, integer $type = Archive::COMPRESS_AUTO )
Set the compression level. |
public
|
|
public
|
|
public
|
#
yieldContents( )
Read the contents of a ZIP archive and return each entry using yield for memory efficiency. |
public
|
|
public
|
|
public
|
#
addFile( string $file, string|
Add a file to the current archive using an existing file in the filesystem |
public
|
#
addData( string|
Add a file to the current Zip archive using the given $data as content |
public
|
|
public
|
|
public
|
|
protected
array
|
|
protected
array
|
|
protected
array
|
|
protected
array
|
|
protected
|
|
protected
string
|
|
protected
string
|
|
protected
integer
|
|
protected
integer
|
#
writebytesAt( string $data, integer $offset )
Write to the open filepointer or memory at the specified offset |
protected
integer
|
|
protected
integer
|
|
protected
integer
|
|
protected
string
|
#
makeCentralFileRecord( integer $offset, integer $ts, integer $crc, integer $len, integer $clen, string $name, boolean|null $comp = null )
Returns a local file header for the given data |
protected
string
|
#
makeLocalFileHeader( integer $ts, integer $crc, integer $len, integer $clen, string $name, boolean|null $comp = null )
Returns a local file header for the given data |
protected
string
|
#
makeCrcAndSize( integer $crc, integer $len, integer $clen )
Returns only a part of the local file header containing the CRC, size and compressed size. Used to update these fields for an already written header. |
protected
array($filename,
|
setCallback()
|
integer |
LOCAL_FILE_HEADER_CRC_OFFSET
|
#
14
|
COMPRESS_AUTO,
COMPRESS_BZIP,
COMPRESS_GZIP,
COMPRESS_NONE
|
protected
string
|
$file
|
#
''
|
protected
|
$fh
|
|
protected
string
|
$memory
|
#
''
|
protected
boolean
|
$closed
|
#
true
|
protected
boolean
|
$writeaccess
|
#
false
|
protected
|
$ctrl_dir
|
|
protected
integer
|
$complevel
|
#
9
|
$callback
|