From df78b1f6eb6cd8f45f49ab7b0d4cc65595181504 Mon Sep 17 00:00:00 2001 From: yunwuxin <448901948@qq.com> Date: Thu, 29 Apr 2021 18:48:04 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=98=E5=8E=9Frpc\File?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/rpc/File.php | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/src/rpc/File.php b/src/rpc/File.php index 5ffd02f..a4d779b 100644 --- a/src/rpc/File.php +++ b/src/rpc/File.php @@ -6,27 +6,15 @@ class File extends \think\File { - protected $persistent = false; - - /** - * 持久化该文件 - */ - public function persists() - { - $this->persistent = true; - } - public function __destruct() { //销毁时删除临时文件 - if ($this->persistent) { - try { - if (file_exists($this->getPathname())) { - unlink($this->getPathname()); - } - } catch (Throwable $e) { - + try { + if (file_exists($this->getPathname())) { + unlink($this->getPathname()); } + } catch (Throwable $e) { + } } }