__construct()
__destruct()
close()
connect()
getConfig()
getStreamContext()
read()
setOptions()
setOutputStream()
setStreamContext()
write()
_checkSocketReadTimeout()
$config
$connectedTo
$context
$method
$outStream
$socket
$sslCryptoTypes
A sockets based (stream\socket\client) adapter class for Zend\Http\Client.
Can be used on almost every PHP environment, and does not require any special extensions.
__construct()
Config is set using setOptions()
__destruct()
If we are in persistent TCP mode, will not close the connection
close()
connect(string $host, int $port, bool $secure)
string
int
bool
\Zend\Http\Client\Adapter\Exception\RuntimeException |
---|
getConfig() : array
array
getStreamContext() : resource
If no stream context is set, will create a default one.
resource
read() : string
setOptions(array | \Traversable $options)
array\Traversable
\Zend\Http\Client\Adapter\Exception\InvalidArgumentException |
---|
setOutputStream(resource $stream) : \Zend\Http\Client\Adapter\Socket
This function sets output stream where the result will be stored.
resource
setStreamContext(mixed $context) : \Zend\Http\Client\Adapter\Socket
Can accept either a pre-existing stream context resource, or an array of stream options, similar to the options array passed to the stream_context_create() PHP function. In such case a new stream context will be created using the passed options.
since | Zend Framework 1.9 |
---|
mixed
Stream context or array of context options
\Zend\Http\Client\Adapter\Exception\InvalidArgumentException |
---|
write(string $method, \Zend\Uri\Uri $uri, string $httpVer, array $headers, string $body) : string
string
\Zend\Uri\Uri
string
array
string
\Zend\Http\Client\Adapter\Exception\RuntimeException |
---|
string
Request as string_checkSocketReadTimeout()
\Zend\Http\Client\Adapter\Exception\TimeoutException |
with READ_TIMEOUT code |
---|
$config : array
$connectedTo : array
$context : resource
$method : string
$outStream : resource
$socket : resource | null
$sslCryptoTypes : array