正在显示
3 个修改的文件
包含
44 行增加
和
0 行删除
@@ -5,6 +5,7 @@ namespace Lib\Imap; | @@ -5,6 +5,7 @@ namespace Lib\Imap; | ||
5 | use Lib\Imap\Request\Folder; | 5 | use Lib\Imap\Request\Folder; |
6 | use Lib\Imap\Request\Folders; | 6 | use Lib\Imap\Request\Folders; |
7 | use Lib\Imap\Request\Login; | 7 | use Lib\Imap\Request\Login; |
8 | +use Lib\Imap\Request\Logout; | ||
8 | use Lib\Imap\Request\Noop; | 9 | use Lib\Imap\Request\Noop; |
9 | 10 | ||
10 | class Imap { | 11 | class Imap { |
@@ -137,4 +138,15 @@ class Imap { | @@ -137,4 +138,15 @@ class Imap { | ||
137 | } | 138 | } |
138 | 139 | ||
139 | 140 | ||
141 | + | ||
142 | + | ||
143 | + public function __destruct() | ||
144 | + { | ||
145 | + // 退出登录 | ||
146 | + (new Logout($this))->exec(); | ||
147 | + unset($this->client); | ||
148 | + // TODO: Implement __destruct() method. | ||
149 | + } | ||
150 | + | ||
151 | + | ||
140 | } | 152 | } |
lib/Imap/Request/Logout.php
0 → 100644
1 | +<?php | ||
2 | + | ||
3 | + | ||
4 | +namespace Lib\Imap\Request; | ||
5 | + | ||
6 | +/** | ||
7 | + * 退出登录 | ||
8 | + * @author:dc | ||
9 | + * @time 2024/9/24 11:10 | ||
10 | + * Class Logout | ||
11 | + * @package Lib\Imap\Request | ||
12 | + */ | ||
13 | +class Logout extends Request{ | ||
14 | + | ||
15 | + | ||
16 | + public function exec(): static | ||
17 | + { | ||
18 | + | ||
19 | + $this->cmd('LOGOUT'); | ||
20 | + | ||
21 | + return $this; | ||
22 | + } | ||
23 | + | ||
24 | + | ||
25 | + | ||
26 | + | ||
27 | +} |
-
请 注册 或 登录 后发表评论