Property | Type | Description | |
---|---|---|---|
$centralDirectory | |||
$fileHandle | |||
$fileHeaderAndData | |||
$localFileHeaderOffset |
Method | Description | |
---|---|---|
_checkLocalFileHeaderAndCentralDir ( unknown_type $localFileHeaderData, unknown_type $centralDirectoryData ) : boolean | 校验 'Local file header' 跟 'Central directory' | |
_checkZlib ( ) : boolean | 检查PHP zlib扩展有没有载入 | |
_findEOFCentralDirectoryRecord ( $filesize ) : string | 读取'end of central directory record'区块数据 | |
_getCentralDirectory ( $modTime, $modDate, $crc, $compressedSize, $unCompressedSize, $filenameLength, $fileHeaderLength, $filename ) : string | 组装 'Central directory' 区块数据 | |
_getDataDescriptor ( $crc, $compressedSize, $unCompressedSize ) : string | 组装 'Data descriptor' 区块数据 | |
_getDosFormatTime ( $timestamp ) : array | 格式化时间为DOS格式 | |
_readCentralDirectoryData ( ) : string | 读取'Central directory' 区块数据 | |
_readLocalFileHeaderAndData ( $centralDirectoryData ) : array | 取得压缩数据中的'Local file header'区块跟压缩的数据 | |
_recoverFromDosFormatTime ( $time, $date ) : integer | 还原DOS格式的时间为时间戳 | |
_unCompressData ( $data, $compressMethod ) : string | 解压被压缩的数据 | |
addFile ( $data, $filename, $timestamp ) : boolean | 增加待压缩的文件 | |
extract ( $file ) : array | 解压缩一个文件 | |
getCompressedFile ( ) : string | 返回压缩后的数据 | |
init ( ) | 初始化 |
public _checkLocalFileHeaderAndCentralDir ( unknown_type $localFileHeaderData, unknown_type $centralDirectoryData ) : boolean | ||
$localFileHeaderData | unknown_type | |
$centralDirectoryData | unknown_type | |
return | boolean |
public _findEOFCentralDirectoryRecord ( $filesize ) : string | ||
$filesize | int 文件大小 | |
return | string |
public _getCentralDirectory ( $modTime, $modDate, $crc, $compressedSize, $unCompressedSize, $filenameLength, $fileHeaderLength, $filename ) : string | ||
$modTime | ||
$modDate | ||
$crc | ||
$compressedSize | ||
$unCompressedSize | ||
$filenameLength | ||
$fileHeaderLength | ||
$filename | ||
return | string |
public _getDataDescriptor ( $crc, $compressedSize, $unCompressedSize ) : string | ||
$crc | ||
$compressedSize | ||
$unCompressedSize | ||
return | string |
public _getDosFormatTime ( $timestamp ) : array | ||
$timestamp | ||
return | array |
public _readCentralDirectoryData ( ) : string | ||
return | string |
public _readLocalFileHeaderAndData ( $centralDirectoryData ) : array | ||
$centralDirectoryData | array 'Central directory' 区块数据 | |
return | array |
public _recoverFromDosFormatTime ( $time, $date ) : integer | ||
$time | ||
$date | ||
return | integer |
public _unCompressData ( $data, $compressMethod ) : string | ||
$data | string 被压缩的数据 | |
$compressMethod | int 压缩的方式 | |
return | string | 解压后的数据 |
public getCompressedFile ( ) : string | ||
return | string | 压缩后的数据 |