PHP Класс Horde_Compress_Zip, horde

The ZIP compression code is partially based on code from: Eric Mueller http://www.zend.com/codex.php?id=535&single=1 Deins125 http://www.zend.com/codex.php?id=470&single=1 The ZIP compression date code is partially based on code from Peter Listiak Copyright 2000-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Автор: Chuck Hagenbuch ([email protected])
Автор: Michael Cochrane ([email protected])
Автор: Michael Slusarz ([email protected])
Наследование: extends Horde_Compress_Base
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$canCompress
$canDecompress

Защищенные свойства (Protected)

Свойство Тип Описание
$_ctrldir array Temporary data for compressing files.
$_methods array ZIP compression methods.
$_tmp resource Temporary contents for compressing files.

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

Метод Описание
checkZipData ( string $data ) : boolean Checks to see if the data is a valid ZIP file.
compress ( array $data, array $params = [] ) : mixed
decompress ( $data, array $params = [] ) : mixed

Защищенные методы

Метод Описание
_addToZipFile ( array $file ) Adds a "file" to the ZIP archive.
_getZipData ( string $data, array $info, integer $key ) : string Returns the data for a specific archived file.
_getZipInfo ( string $data ) : array Get the list of files/data from the zip archive.
_unix2DOSTime ( integer $unixtime = null ) : integer Converts a UNIX timestamp to a 4-byte DOS date and time format (date in high 2-bytes, time in low 2-bytes allowing magnitude comparison).

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

_addToZipFile() защищенный Метод

Adds a "file" to the ZIP archive.
protected _addToZipFile ( array $file )
$file array See self::createZipFile().

_getZipData() защищенный Метод

Returns the data for a specific archived file.
protected _getZipData ( string $data, array $info, integer $key ) : string
$data string The zip archive contents.
$info array The information array from _getZipInfo().
$key integer The position of the file in the archive.
Результат string The file data.

_getZipInfo() защищенный Метод

Get the list of files/data from the zip archive.
protected _getZipInfo ( string $data ) : array
$data string The zipfile data.
Результат array See decompress() for the format.

_unix2DOSTime() защищенный Метод

Converts a UNIX timestamp to a 4-byte DOS date and time format (date in high 2-bytes, time in low 2-bytes allowing magnitude comparison).
protected _unix2DOSTime ( integer $unixtime = null ) : integer
$unixtime integer The current UNIX timestamp.
Результат integer The current date in a 4-byte DOS format.

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

Checks to see if the data is a valid ZIP file.
public checkZipData ( string $data ) : boolean
$data string The ZIP file data.
Результат boolean True if valid, false if invalid.

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

public compress ( array $data, array $params = [] ) : mixed
$data array The data to compress. Requires an array of arrays. Each subarray should contain these fields: - data: (string/resource) The data to compress. - name: (string) The pathname to the file. - time: (integer) [optional] The timestamp to use for the file.
$params array The parameter array. - stream: (boolean) If set, return a stream instead of a string. DEFAULT: Return string
Результат mixed The ZIP file as either a string or a stream resource.

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

public decompress ( $data, array $params = [] ) : mixed
$params array The parameter array. - action: (integer) [REQUIRED] The action to take on the data. Either self::ZIP_LIST or self::ZIP_DATA. - info: (array) [REQUIRED for ZIP_DATA] The zipfile list. - key: (integer) [REQUIRED for ZIP_DATA] The position of the file in the archive list.
Результат mixed If action is self::ZIP_DATA, the uncompressed data. If action is self::ZIP_LIST, an array with the KEY as the position in the zipfile and these values: - attr: File attributes - crc: CRC checksum - csize: Compressed file size - date: File modification time - name: Filename - method: Compression method - size: Original file size - type: File type

Описание свойств

$_ctrldir защищенное свойство

Temporary data for compressing files.
protected array $_ctrldir
Результат array

$_methods защищенное свойство

ZIP compression methods.
protected array $_methods
Результат array

$_tmp защищенное свойство

Temporary contents for compressing files.
protected resource $_tmp
Результат resource

$canCompress публичное свойство

public $canCompress

$canDecompress публичное свойство

public $canDecompress