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