Interface.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Http
  17. * @subpackage Client_Adapter
  18. * @version $Id$
  19. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  20. * @license http://framework.zend.com/license/new-bsd New BSD License
  21. */
  22. /**
  23. * An interface description for Zend_Http_Client_Adapter classes.
  24. *
  25. * These classes are used as connectors for Zend_Http_Client, performing the
  26. * tasks of connecting, writing, reading and closing connection to the server.
  27. *
  28. * @category Zend
  29. * @package Zend_Http
  30. * @subpackage Client_Adapter
  31. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  32. * @license http://framework.zend.com/license/new-bsd New BSD License
  33. */
  34. interface Zend_Http_Client_Adapter_Interface
  35. {
  36. /**
  37. * Set the configuration array for the adapter
  38. *
  39. * @param array $config
  40. */
  41. public function setConfig($config = array());
  42. /**
  43. * Connect to the remote server
  44. *
  45. * @param string $host
  46. * @param int $port
  47. * @param boolean $secure
  48. */
  49. public function connect($host, $port = 80, $secure = false);
  50. /**
  51. * Send request to the remote server
  52. *
  53. * @param string $method
  54. * @param Zend_Uri_Http $url
  55. * @param string $http_ver
  56. * @param array $headers
  57. * @param string $body
  58. * @return string Request as text
  59. */
  60. public function write($method, $url, $http_ver = '1.1', $headers = array(), $body = '');
  61. /**
  62. * Read response from server
  63. *
  64. * @return string
  65. */
  66. public function read();
  67. /**
  68. * Close the connection to the server
  69. *
  70. */
  71. public function close();
  72. }