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
파일 보기 프로젝트 열기: horde/horde

공개 프로퍼티들

프로퍼티 타입 설명
$canCompress
$canDecompress

보호된 프로퍼티들

프로퍼티 타입 설명
$_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