File indexing completed on 2025-01-19 05:21:14

0001 <?php
0002 
0003 /**
0004  * Zend Framework
0005  *
0006  * LICENSE
0007  *
0008  * This source file is subject to the new BSD license that is bundled
0009  * with this package in the file LICENSE.txt.
0010  * It is also available through the world-wide-web at this URL:
0011  * http://framework.zend.com/license/new-bsd
0012  * If you did not receive a copy of the license and are unable to
0013  * obtain it through the world-wide-web, please send an email
0014  * to license@zend.com so we can send you a copy immediately.
0015  *
0016  * @category   Zend
0017  * @package    Zend_Http
0018  * @subpackage Client_Adapter
0019  * @version    $Id$
0020  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0021  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0022  */
0023 
0024 /**
0025  * An interface description for Zend_Http_Client_Adapter classes.
0026  *
0027  * These classes are used as connectors for Zend_Http_Client, performing the
0028  * tasks of connecting, writing, reading and closing connection to the server.
0029  *
0030  * @category   Zend
0031  * @package    Zend_Http
0032  * @subpackage Client_Adapter
0033  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0034  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0035  */
0036 interface Zend_Http_Client_Adapter_Interface
0037 {
0038     /**
0039      * Set the configuration array for the adapter
0040      *
0041      * @param array $config
0042      */
0043     public function setConfig($config = array());
0044 
0045     /**
0046      * Connect to the remote server
0047      *
0048      * @param string  $host
0049      * @param int     $port
0050      * @param boolean $secure
0051      */
0052     public function connect($host, $port = 80, $secure = false);
0053 
0054     /**
0055      * Send request to the remote server
0056      *
0057      * @param string        $method
0058      * @param Zend_Uri_Http $url
0059      * @param string        $http_ver
0060      * @param array         $headers
0061      * @param string        $body
0062      * @return string Request as text
0063      */
0064     public function write($method, $url, $http_ver = '1.1', $headers = array(), $body = '');
0065 
0066     /**
0067      * Read response from server
0068      *
0069      * @return string
0070      */
0071     public function read();
0072 
0073     /**
0074      * Close the connection to the server
0075      *
0076      */
0077     public function close();
0078 }