\Zip

Zip 文件包工具

Summary

Methods
Properties
Constants
__construct()
unzip()
zip()
fileList()
No public properties found
No constants found
No protected methods found
$zip
$root
$ignored_names
N/A
createZip()
getTypeList()
No private properties found
N/A

Properties

$zip

$zip : 

Type

$root

$root : 

Type

$ignored_names

$ignored_names : 

Type

Methods

__construct()

__construct() 

unzip()

unzip(string  $zipfile, string  $path) : \booleam

解压zip文件到指定文件夹

Parameters

string $zipfile

压缩文件路径

string $path

压缩包解压到的目标路径

Returns

\booleam —

解压成功返回 true 否则返回 false

zip()

zip(string  $zipfile, \strng  $folder, array  $ignored = null) : \booleam

创建压缩文件

Parameters

string $zipfile

将要生成的压缩文件路径

\strng $folder

将要被压缩的文件夹路径

array $ignored

要忽略的文件列表

Returns

\booleam —

压缩包生成成功返回true 否则返回 false

fileList()

fileList(string  $zipfile) : array

读取压缩包文件与目录列表

Parameters

string $zipfile

压缩包文件

Returns

array —

文件与目录列表

createZip()

createZip(string  $folder, string  $parent = null) : void

递归添加文件到压缩包

Parameters

string $folder

添加到压缩包的文件夹路径

string $parent

添加到压缩包的文件夹上级路径

getTypeList()

getTypeList(  $bin) : boolean

得到文件头与文件类型映射表

Parameters

$bin

string 文件的二进制前一段字符

Returns

boolean