Zend\Http\Client\Adapter\Curl
An adapter class for Zend\Http\Client based on the curl extension.
Curl requires libcurl. See for full requirements the PHP manual: http://php.net/curl
Synopsis
class Curl
implements
AdapterInterface,StreamInterface
{
- // members
- protected array $config;
- protected array $connectedTo;
- protected resource|null $curl;
- protected array $invalidOverwritableCurlOptions;
- protected string $response;
- protected resource $outputStream;
- // methods
- public void __construct()
- public Curl setOptions()
- public array getConfig()
- public Curl setCurlOption()
- public void connect()
- public string write()
- public string read()
- public void close()
- public resource getHandle()
- public Curl setOutputStream()
- public int readHeader()
Hierarchy
Members
protected
- $config
—
array
Parameters array - $connectedTo
—
array
What host/port are we connected to? - $curl
—
Zend\Http\Client\Adapter\resource|null
The curl session handle - $invalidOverwritableCurlOptions
—
array
List of cURL options that should never be overwritten - $outputStream
—
resource
Stream for storing output - $response
—
string
Response gotten from server
Methods
public
- __construct() — Adapter constructor
- close() — Close the connection to the server
- connect() — Initialize curl
- getConfig() — Retrieve the array of all configuration options
- getHandle() — Get cUrl Handle
- read() — Return read response from server
- readHeader() — Header reader function for CURL
- setCurlOption() — Direct setter for cURL adapter related options.
- setOptions() — Set the configuration array for the adapter
- setOutputStream() — Set output stream for the response
- write() — Send request to the remote server