/framework/vendor/swift/lib/classes/Swift/Transport/IoBuffer.php

http://zoop.googlecode.com/ · PHP · 65 lines · 12 code · 11 blank · 42 comment · 0 complexity · 8a2923f9c7e1a4005373340366c3094c MD5 · raw file

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