This repository has been archived by the owner on Dec 13, 2023. It is now read-only.
/
Connection.php
81 lines (79 loc) · 2.21 KB
/
Connection.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
/**
* Swift Mailer Connection Interface
* All connection handlers extend this abstract class
* Please read the LICENSE file
* @author Chris Corbyn <chris@w3style.co.uk>
* @package Swift_Connection
* @license GNU Lesser General Public License
*/
/**
* Swift Connection Interface
* Lists methods which are required by any connections
* @package Swift_Connection
* @author Chris Corbyn <chris@w3style.co.uk>
*/
interface Swift_Connection
{
/**
* Try to start the connection
* @throws Swift_ConnectionException If the connection cannot be started
*/
public function start();
/**
* Return the contents of the buffer
* @return string
* @throws Swift_ConnectionException If the buffer cannot be read
*/
public function read();
/**
* Write a command to the buffer
* @param string The command to send
* @throws Swift_ConnectionException If the write fails
*/
public function write($command, $end="\r\n");
/**
* Try to stop the connection
* @throws Swift_ConnectionException If the connection cannot be closed/stopped
*/
public function stop();
/**
* Check if the connection is up or not
* @return boolean
*/
public function isAlive();
/**
* Add an extension which is available on this connection
* @param string The name of the extension
* @param array The list of attributes for the extension
*/
public function setExtension($name, $list=array());
/**
* Check if an extension exists by the name $name
* @param string The name of the extension
* @return boolean
*/
public function hasExtension($name);
/**
* Get the list of attributes for the extension $name
* @param string The name of the extension
* @return array
* @throws Swift_ConnectionException If no such extension can be found
*/
public function getAttributes($name);
/**
* Execute logic needed after SMTP greetings
* @param Swift An instance of Swift
*/
public function postConnect(Swift $instance);
/**
* Returns TRUE if the connection needs a EHLO greeting.
* @return boolean
*/
public function getRequiresEHLO();
/**
* Set if the connection needs a EHLO greeting.
* @param boolean
*/
public function setRequiresEHLO($set);
}