update:更新zip类
This commit is contained in:
parent
bcf37924d3
commit
e15838386f
@ -30,16 +30,17 @@ class Zip
|
|||||||
*
|
*
|
||||||
* @time 2020年07月19日
|
* @time 2020年07月19日
|
||||||
* @param $zip
|
* @param $zip
|
||||||
* @throws \Exception
|
* @param null $flags
|
||||||
* @return $this
|
* @return $this
|
||||||
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public function make($zip)
|
public function make($zip, $flags = null)
|
||||||
{
|
{
|
||||||
if (FileSystem::extension($zip) != self::EXTENSION) {
|
if (FileSystem::extension($zip) != self::EXTENSION) {
|
||||||
throw new \Exception("make zip muse set [zip] extension");
|
throw new \Exception("make zip muse set [zip] extension");
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->zipArchive->open($zip, \ZipArchive::CREATE);
|
$this->zipArchive->open($zip, $flags);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
@ -113,7 +114,9 @@ class Zip
|
|||||||
*/
|
*/
|
||||||
public function close()
|
public function close()
|
||||||
{
|
{
|
||||||
|
if ($this->zipArchive) {
|
||||||
$this->zipArchive->close();
|
$this->zipArchive->close();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user