CurlMulti
extends AbstractCurl
in package
HTTP client curl multi handler class
Tags
Table of Contents
Properties
- $clients : array<string|int, mixed>
- Curl clients
- $httpVersion : string
- HTTP version
- $options : array<string|int, mixed>
- Curl options
- $resource : mixed
- Client resource object
- $response : mixed
- Curl response
- $uri : string|null
- URI string
Methods
- __construct() : mixed
- Constructor
- addClient() : CurlMulti
- Add Curl client
- addClients() : CurlMulti
- Add Curl clients
- create() : CurlMulti
- Factory method to create a Curl multi handler
- curl() : mixed
- Return curl resource (alias to $this->getResource())
- disconnect() : void
- Close the handler connection
- getAllResponses() : array<string|int, mixed>
- Get all responses
- getClient() : Client|null
- Get Curl client
- getClientContent() : Client|string|null
- Get Curl client content
- getClients() : array<string|int, mixed>
- Get Curl clients
- getErrorMessage() : string
- Get Curl error number
- getErrorNumber() : int
- Get Curl error number
- getHttpVersion() : string
- Get the URI string
- getInfo() : array<string|int, mixed>|false
- Get info about the Curl multi-handler
- getOption() : mixed
- Get a Curl option
- getOptions() : array<string|int, mixed>
- Get Curl options
- getResource() : mixed
- Get the resource
- getResponse() : mixed
- Get Curl response
- getUri() : string|null
- Get the URI string
- getUriObject() : Uri
- Get the URI as an object
- hasClient() : bool
- Has Curl client
- hasOption() : bool
- Has a Curl option
- hasOptions() : bool
- Has Curl options
- hasResource() : bool
- Determine whether or not resource is available
- hasResponse() : bool
- Has a Curl response
- hasUri() : bool
- Determine whether or not there is a URI string
- isComplete() : bool
- Determine if the response is complete
- isError() : bool|null
- Determine if the response is an error
- isSuccess() : bool|null
- Determine if the response is a success
- parseResponse() : mixed
- Get Curl response content
- removeClient() : CurlMulti
- Remove Curl client
- removeOption() : AbstractCurl
- Remove Curl option
- reset() : CurlMulti
- Method to reset the handler
- resource() : mixed
- Get the resource (alias method)
- send() : int
- Method to send the multiple Curl connections
- sendAsync() : Promise
- Method to send the request asynchronously
- setOption() : AbstractCurl
- Set Curl option
- setOptions() : AbstractCurl
- Set Curl options
- setResponse() : AbstractCurl
- Get Curl response
- setWait() : int
- Set a wait time until there is any activity on a connection
- version() : array<string|int, mixed>
- Return the Curl version
Properties
$clients
Curl clients
protected
array<string|int, mixed>
$clients
= []
$httpVersion
HTTP version
protected
string
$httpVersion
= '1.1'
$options
Curl options
protected
array<string|int, mixed>
$options
= []
$resource
Client resource object
protected
mixed
$resource
= null
$response
Curl response
protected
mixed
$response
= null
$uri
URI string
protected
string|null
$uri
= null
Methods
__construct()
Constructor
public
__construct([array<string|int, mixed>|null $options = null ]) : mixed
Instantiate the Curl multi handler object
Parameters
- $options : array<string|int, mixed>|null = null
Tags
addClient()
Add Curl client
public
addClient(Client $curlClient[, string|null $name = null ]) : CurlMulti
Parameters
- $curlClient : Client
- $name : string|null = null
Return values
CurlMultiaddClients()
Add Curl clients
public
addClients(array<string|int, mixed> $clients) : CurlMulti
Parameters
- $clients : array<string|int, mixed>
Return values
CurlMulticreate()
Factory method to create a Curl multi handler
public
static create([array<string|int, mixed>|null $options = null ]) : CurlMulti
Parameters
- $options : array<string|int, mixed>|null = null
Return values
CurlMulticurl()
Return curl resource (alias to $this->getResource())
public
curl() : mixed
disconnect()
Close the handler connection
public
disconnect() : void
getAllResponses()
Get all responses
public
getAllResponses() : array<string|int, mixed>
Return values
array<string|int, mixed>getClient()
Get Curl client
public
getClient(string $name) : Client|null
Parameters
- $name : string
Return values
Client|nullgetClientContent()
Get Curl client content
public
getClientContent(string|Client $curlClient) : Client|string|null
Parameters
- $curlClient : string|Client
Return values
Client|string|nullgetClients()
Get Curl clients
public
getClients() : array<string|int, mixed>
Return values
array<string|int, mixed>getErrorMessage()
Get Curl error number
public
getErrorMessage() : string
Return values
stringgetErrorNumber()
Get Curl error number
public
getErrorNumber() : int
Return values
intgetHttpVersion()
Get the URI string
public
getHttpVersion() : string
Return values
stringgetInfo()
Get info about the Curl multi-handler
public
getInfo() : array<string|int, mixed>|false
Return values
array<string|int, mixed>|falsegetOption()
Get a Curl option
public
getOption(int $opt) : mixed
Parameters
- $opt : int
getOptions()
Get Curl options
public
getOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>getResource()
Get the resource
public
getResource() : mixed
getResponse()
Get Curl response
public
getResponse() : mixed
getUri()
Get the URI string
public
getUri() : string|null
Return values
string|nullgetUriObject()
Get the URI as an object
public
getUriObject() : Uri
Return values
UrihasClient()
Has Curl client
public
hasClient(string $name) : bool
Parameters
- $name : string
Return values
boolhasOption()
Has a Curl option
public
hasOption(int $opt) : bool
Parameters
- $opt : int
Return values
boolhasOptions()
Has Curl options
public
hasOptions() : bool
Return values
boolhasResource()
Determine whether or not resource is available
public
hasResource() : bool
Return values
boolhasResponse()
Has a Curl response
public
hasResponse() : bool
Return values
boolhasUri()
Determine whether or not there is a URI string
public
hasUri() : bool
Return values
boolisComplete()
Determine if the response is complete
public
isComplete() : bool
Return values
boolisError()
Determine if the response is an error
public
isError([bool $strict = false ]) : bool|null
Parameters
- $strict : bool = false
Return values
bool|nullisSuccess()
Determine if the response is a success
public
isSuccess([bool $strict = true ]) : bool|null
Parameters
- $strict : bool = true
Return values
bool|nullparseResponse()
Get Curl response content
public
parseResponse(string|Client $curlClient) : mixed
Parameters
- $curlClient : string|Client
removeClient()
Remove Curl client
public
removeClient([string|null $name = null ][, Client|null $curlClient = null ]) : CurlMulti
Parameters
- $name : string|null = null
- $curlClient : Client|null = null
Tags
Return values
CurlMultiremoveOption()
Remove Curl option
public
removeOption(int $opt) : AbstractCurl
Parameters
- $opt : int
Return values
AbstractCurlreset()
Method to reset the handler
public
reset() : CurlMulti
Return values
CurlMultiresource()
Get the resource (alias method)
public
resource() : mixed
send()
Method to send the multiple Curl connections
public
send([int|null &$active = null ]) : int
Parameters
- $active : int|null = null
Return values
intsendAsync()
Method to send the request asynchronously
public
sendAsync() : Promise
Return values
PromisesetOption()
Set Curl option
public
setOption(int $opt, mixed $val) : AbstractCurl
Parameters
- $opt : int
- $val : mixed
Return values
AbstractCurlsetOptions()
Set Curl options
public
setOptions(array<string|int, mixed> $options) : AbstractCurl
Parameters
- $options : array<string|int, mixed>
Return values
AbstractCurlsetResponse()
Get Curl response
public
setResponse(mixed $response) : AbstractCurl
Parameters
- $response : mixed
Return values
AbstractCurlsetWait()
Set a wait time until there is any activity on a connection
public
setWait([float $timeout = 1.0 ]) : int
Parameters
- $timeout : float = 1.0
Return values
intversion()
Return the Curl version
public
version() : array<string|int, mixed>