PHP Класс PHPZip\Zip\File\Zip

Наследование: extends PHPZip\Zip\Core\AbstractZipArchive
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( boolean $useZipFile = false ) Constructor.
__destruct ( ) Destructor.
getArchiveSize ( ) : integer Return the current size of the archive
getZipData ( ) : string Get the zip file contents If the zip haven't been finalized yet, this will cause it to become finalized
getZipFile ( ) : resource Get the handle resource for the archive zip file.
onBeginAddFile ( array $params ) Called by superclass when specialised action is needed at the start of adding a file to the archive.
onBeginBuildResponseHeader ( ) Called by superclass when specialised action is needed at the start of sending the zip file response header.
onBuildZipEntry ( array $params ) Called by superclass when specialised action is needed while building a zip entry.
onEndAddFile ( array $params ) Called by superclass when specialised action is needed at the end of adding a file to the archive.
onEndBuildResponseHeader ( ) Called by superclass when specialised action is needed at the end of sending the zip file response header.
onOpenStream ( ) Called by superclass when specialised action is needed while opening a stream.
onProcessFile ( array $params ) Called by superclass when specialised action is needed while processing a file.
saveZipFile ( $fileName ) : boolean Alias for setZipFile
sendZip ( String $fileName = null, String $contentType = self::CONTENT_TYPE, String $utf8FileName = null, boolean $inline = false ) : boolean Send the archive as a zip download
setZipFile ( string $fileName ) : boolean Set zip file to write zip data to.
zipFlush ( ) Flush Zip Data stored in memory, to a temp file.
zipFlushBuffer ( )
zipVerifyMemBuffer ( integer $gzLength ) Verify if the memory buffer is about to be exceeded.
zipWrite ( string $data )

Описание методов

__construct() публичный Метод

Constructor.
Автор: A. Grandt ([email protected])
Автор: Greg Kappatos
public __construct ( boolean $useZipFile = false )
$useZipFile boolean Write temp zip data to tempFile? Default FALSE

__destruct() публичный Метод

Perform clean up actions.
Автор: A. Grandt ([email protected])
public __destruct ( )

getArchiveSize() публичный Метод

Return the current size of the archive
Автор: A. Grandt ([email protected])
public getArchiveSize ( ) : integer
Результат integer Size of the archive

getZipData() публичный Метод

Get the zip file contents If the zip haven't been finalized yet, this will cause it to become finalized
Автор: A. Grandt ([email protected])
Автор: Greg Kappatos
public getZipData ( ) : string
Результат string zip data

getZipFile() публичный Метод

If the zip haven't been finalized yet, this will cause it to become finalized
Автор: A. Grandt ([email protected])
public getZipFile ( ) : resource
Результат resource zip file handle

onBeginAddFile() публичный Метод

Called by superclass when specialised action is needed at the start of adding a file to the archive.
Автор: A. Grandt ([email protected])
Автор: Greg Kappatos
public onBeginAddFile ( array $params )
$params array Array that contains gzLength.

onBeginBuildResponseHeader() публичный Метод

Called by superclass when specialised action is needed at the start of sending the zip file response header.
Автор: A. Grandt ([email protected])
Автор: Greg Kappatos

onBuildZipEntry() публичный Метод

Called by superclass when specialised action is needed while building a zip entry.
Автор: A. Grandt ([email protected])
Автор: Greg Kappatos
public onBuildZipEntry ( array $params )
$params array Array that contains zipEntry.

onEndAddFile() публичный Метод

Called by superclass when specialised action is needed at the end of adding a file to the archive.
Автор: A. Grandt ([email protected])
Автор: Greg Kappatos
public onEndAddFile ( array $params )
$params array Array that contains gzData.

onEndBuildResponseHeader() публичный Метод

Called by superclass when specialised action is needed at the end of sending the zip file response header.
Автор: A. Grandt ([email protected])
Автор: Greg Kappatos

onOpenStream() публичный Метод

Called by superclass when specialised action is needed while opening a stream.
Автор: A. Grandt ([email protected])
Автор: Greg Kappatos
public onOpenStream ( )

onProcessFile() публичный Метод

Called by superclass when specialised action is needed while processing a file.
Автор: A. Grandt ([email protected])
Автор: Greg Kappatos
public onProcessFile ( array $params )
$params array Array that contains data.

saveZipFile() публичный Метод

Alias for setZipFile
public saveZipFile ( $fileName ) : boolean
$fileName
Результат boolean

sendZip() публичный Метод

Send the archive as a zip download
Автор: A. Grandt ([email protected])
public sendZip ( String $fileName = null, String $contentType = self::CONTENT_TYPE, String $utf8FileName = null, boolean $inline = false ) : boolean
$fileName String The name of the Zip archive, in ISO-8859-1 (or ASCII) encoding, ie. "archive.zip". Optional, defaults to null, which means that no ISO-8859-1 encoded file name will be specified.
$contentType String Content mime type. Optional, defaults to "application/zip".
$utf8FileName String The name of the Zip archive, in UTF-8 encoding. Optional, defaults to null, which means that no UTF-8 encoded file name will be specified.
$inline boolean Use Content-Disposition with "inline" instead of "attachment". Optional, defaults to false.
Результат boolean $success

setZipFile() публичный Метод

This will cause all present and future data written to this class to be written to this file. This can be used at any time, even after the Zip Archive have been finalized. Any previous file will be closed. Warning: If the given file already exists, it will be overwritten.
Автор: A. Grandt ([email protected])
public setZipFile ( string $fileName ) : boolean
$fileName string
Результат boolean Success

zipFlush() публичный Метод

Flush Zip Data stored in memory, to a temp file.
Автор: A. Grandt ([email protected])
public zipFlush ( )

zipFlushBuffer() публичный Метод

Автор: A. Grandt ([email protected])
public zipFlushBuffer ( )

zipVerifyMemBuffer() публичный Метод

Verify if the memory buffer is about to be exceeded.
Автор: A. Grandt ([email protected])
public zipVerifyMemBuffer ( integer $gzLength )
$gzLength integer length of the pending data.

zipWrite() публичный Метод

Автор: A. Grandt ([email protected])
public zipWrite ( string $data )
$data string