1 | <?php |
||
32 | class POP3 |
||
33 | { |
||
34 | /** |
||
35 | * The POP3 PHPMailer Version number. |
||
36 | * |
||
37 | * @var string |
||
38 | */ |
||
39 | public $Version = '5.2.7'; |
||
40 | |||
41 | /** |
||
42 | * Default POP3 port number. |
||
43 | * |
||
44 | * @var int |
||
45 | */ |
||
46 | public $POP3_PORT = 110; |
||
47 | |||
48 | /** |
||
49 | * Default timeout in seconds. |
||
50 | * |
||
51 | * @var int |
||
52 | */ |
||
53 | public $POP3_TIMEOUT = 30; |
||
54 | |||
55 | /** |
||
56 | * POP3 Carriage Return + Line Feed. |
||
57 | * |
||
58 | * @var string |
||
59 | * |
||
60 | * @deprecated Use the constant instead |
||
61 | */ |
||
62 | public $CRLF = "\r\n"; |
||
63 | |||
64 | /** |
||
65 | * Debug display level. |
||
66 | * Options: 0 = no, 1+ = yes. |
||
67 | * |
||
68 | * @var int |
||
69 | */ |
||
70 | public $do_debug = 0; |
||
71 | |||
72 | /** |
||
73 | * POP3 mail server hostname. |
||
74 | * |
||
75 | * @var string |
||
76 | */ |
||
77 | public $host; |
||
78 | |||
79 | /** |
||
80 | * POP3 port number. |
||
81 | * |
||
82 | * @var int |
||
83 | */ |
||
84 | public $port; |
||
85 | |||
86 | /** |
||
87 | * POP3 Timeout Value in seconds. |
||
88 | * |
||
89 | * @var int |
||
90 | */ |
||
91 | public $tval; |
||
92 | |||
93 | /** |
||
94 | * POP3 username. |
||
95 | * |
||
96 | * @var string |
||
97 | */ |
||
98 | public $username; |
||
99 | |||
100 | /** |
||
101 | * POP3 password. |
||
102 | * |
||
103 | * @var string |
||
104 | */ |
||
105 | public $password; |
||
106 | |||
107 | /** |
||
108 | * Resource handle for the POP3 connection socket. |
||
109 | * |
||
110 | * @var resource |
||
111 | */ |
||
112 | private $pop_conn; |
||
113 | |||
114 | /** |
||
115 | * Are we connected? |
||
116 | * |
||
117 | * @var bool |
||
118 | */ |
||
119 | private $connected; |
||
120 | |||
121 | /** |
||
122 | * Error container. |
||
123 | * |
||
124 | * @var array |
||
125 | */ |
||
126 | private $error; |
||
127 | |||
128 | /** |
||
129 | * Line break constant. |
||
130 | */ |
||
131 | const CRLF = "\r\n"; |
||
132 | |||
133 | /** |
||
134 | * Constructor. |
||
135 | */ |
||
136 | public function __construct() |
||
142 | |||
143 | /** |
||
144 | * Simple static wrapper for all-in-one POP before SMTP. |
||
145 | * |
||
146 | * @param $host |
||
147 | * @param bool $port |
||
148 | * @param bool $tval |
||
149 | * @param string $username |
||
150 | * @param string $password |
||
151 | * @param int $debug_level |
||
152 | * |
||
153 | * @return bool |
||
154 | */ |
||
155 | public static function popBeforeSmtp( |
||
167 | |||
168 | /** |
||
169 | * Authenticate with a POP3 server. |
||
170 | * A connect, login, disconnect sequence |
||
171 | * appropriate for POP-before SMTP authorisation. |
||
172 | * |
||
173 | * @param string $host |
||
174 | * @param bool|int $port |
||
175 | * @param bool|int $tval |
||
176 | * @param string $username |
||
177 | * @param string $password |
||
178 | * @param int $debug_level |
||
179 | * |
||
180 | * @return bool |
||
181 | */ |
||
182 | public function authorise($host, $port = false, $tval = false, $username = '', $password = '', $debug_level = 0) |
||
217 | |||
218 | /** |
||
219 | * Connect to a POP3 server. |
||
220 | * |
||
221 | * @param string $host |
||
222 | * @param bool|int $port |
||
223 | * @param int $tval |
||
224 | * |
||
225 | * @return bool |
||
226 | */ |
||
227 | public function connect($host, $port = false, $tval = 30) |
||
290 | |||
291 | /** |
||
292 | * Log in to the POP3 server. |
||
293 | * Does not support APOP (RFC 2828, 4949). |
||
294 | * |
||
295 | * @param string $username |
||
296 | * @param string $password |
||
297 | * |
||
298 | * @return bool |
||
299 | */ |
||
300 | public function login($username = '', $password = '') |
||
330 | |||
331 | /** |
||
332 | * Disconnect from the POP3 server. |
||
333 | */ |
||
334 | public function disconnect() |
||
341 | |||
342 | /** |
||
343 | * Get a response from the POP3 server. |
||
344 | * $size is the maximum number of bytes to retrieve. |
||
345 | * |
||
346 | * @param int $size |
||
347 | * |
||
348 | * @return string |
||
349 | */ |
||
350 | private function getResponse($size = 128) |
||
359 | |||
360 | /** |
||
361 | * Send raw data to the POP3 server. |
||
362 | * |
||
363 | * @param string $string |
||
364 | * |
||
365 | * @return int |
||
366 | */ |
||
367 | private function sendString($string) |
||
379 | |||
380 | /** |
||
381 | * Checks the POP3 server response. |
||
382 | * Looks for for +OK or -ERR. |
||
383 | * |
||
384 | * @param string $string |
||
385 | * |
||
386 | * @return bool |
||
387 | */ |
||
388 | private function checkResponse($string) |
||
405 | |||
406 | /** |
||
407 | * Display errors if debug is enabled. |
||
408 | */ |
||
409 | private function displayErrors() |
||
417 | |||
418 | /** |
||
419 | * POP3 connection error handler. |
||
420 | * |
||
421 | * @param int $errno |
||
422 | * @param string $errstr |
||
423 | * @param string $errfile |
||
424 | * @param int $errline |
||
425 | */ |
||
426 | private function catchWarning($errno, $errstr, $errfile, $errline) |
||
436 | } |
||
437 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..