From e15838386f28f1eac0d3f3387b08d174ccc0647a Mon Sep 17 00:00:00 2001 From: JaguarJack Date: Mon, 10 Aug 2020 11:17:32 +0800 Subject: [PATCH] =?UTF-8?q?update:=E6=9B=B4=E6=96=B0zip=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/catcher/library/Zip.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/extend/catcher/library/Zip.php b/extend/catcher/library/Zip.php index 3a6148e..2efef89 100644 --- a/extend/catcher/library/Zip.php +++ b/extend/catcher/library/Zip.php @@ -30,16 +30,17 @@ class Zip * * @time 2020年07月19日 * @param $zip - * @throws \Exception + * @param null $flags * @return $this + * @throws \Exception */ - public function make($zip) + public function make($zip, $flags = null) { if (FileSystem::extension($zip) != self::EXTENSION) { throw new \Exception("make zip muse set [zip] extension"); } - $this->zipArchive->open($zip, \ZipArchive::CREATE); + $this->zipArchive->open($zip, $flags); return $this; } @@ -113,7 +114,9 @@ class Zip */ public function close() { - $this->zipArchive->close(); + if ($this->zipArchive) { + $this->zipArchive->close(); + } } } \ No newline at end of file