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