|
0
|
1 |
<?php |
|
|
2 |
|
|
|
3 |
/* |
|
|
4 |
* This file is part of SwiftMailer. |
|
|
5 |
* (c) 2004-2009 Chris Corbyn |
|
|
6 |
* |
|
|
7 |
* For the full copyright and license information, please view the LICENSE |
|
|
8 |
* file that was distributed with this source code. |
|
|
9 |
*/ |
|
|
10 |
|
|
|
11 |
|
|
|
12 |
/** |
|
|
13 |
* Buffers input and output to a resource. |
|
|
14 |
* @package Swift |
|
|
15 |
* @subpackage Transport |
|
|
16 |
* @author Chris Corbyn |
|
|
17 |
*/ |
|
|
18 |
interface Swift_Transport_IoBuffer |
|
|
19 |
extends Swift_InputByteStream, Swift_OutputByteStream |
|
|
20 |
{ |
|
|
21 |
|
|
|
22 |
/** A socket buffer over TCP */ |
|
|
23 |
const TYPE_SOCKET = 0x0001; |
|
|
24 |
|
|
|
25 |
/** A process buffer with I/O support */ |
|
|
26 |
const TYPE_PROCESS = 0x0010; |
|
|
27 |
|
|
|
28 |
/** |
|
|
29 |
* Perform any initialization needed, using the given $params. |
|
|
30 |
* Parameters will vary depending upon the type of IoBuffer used. |
|
|
31 |
* @param array $params |
|
|
32 |
*/ |
|
|
33 |
public function initialize(array $params); |
|
|
34 |
|
|
|
35 |
/** |
|
|
36 |
* Set an individual param on the buffer (e.g. switching to SSL). |
|
|
37 |
* @param string $param |
|
|
38 |
* @param mixed $value |
|
|
39 |
*/ |
|
|
40 |
public function setParam($param, $value); |
|
|
41 |
|
|
|
42 |
/** |
|
|
43 |
* Perform any shutdown logic needed. |
|
|
44 |
*/ |
|
|
45 |
public function terminate(); |
|
|
46 |
|
|
|
47 |
/** |
|
|
48 |
* Set an array of string replacements which should be made on data written |
|
|
49 |
* to the buffer. This could replace LF with CRLF for example. |
|
|
50 |
* @param string[] $replacements |
|
|
51 |
*/ |
|
|
52 |
public function setWriteTranslations(array $replacements); |
|
|
53 |
|
|
|
54 |
/** |
|
|
55 |
* Get a line of output (including any CRLF). |
|
|
56 |
* The $sequence number comes from any writes and may or may not be used |
|
|
57 |
* depending upon the implementation. |
|
|
58 |
* @param int $sequence of last write to scan from |
|
|
59 |
* @return string |
|
|
60 |
*/ |
|
|
61 |
public function readLine($sequence); |
|
|
62 |
|
|
|
63 |
} |