Documentation

CurlMulti extends AbstractCurl
in package

HTTP client curl multi handler class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
5.2.0

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 = []

$options

Curl options

protected array<string|int, mixed> $options = []

$response

Curl response

protected mixed $response = 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
throws
Exception

addClients()

Add Curl clients

public addClients(array<string|int, mixed> $clients) : CurlMulti
Parameters
$clients : array<string|int, mixed>
Return values
CurlMulti

create()

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
CurlMulti

curl()

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|null

getClientContent()

Get Curl client content

public getClientContent(string|Client $curlClient) : Client|string|null
Parameters
$curlClient : string|Client
Return values
Client|string|null

getClients()

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
string

getErrorNumber()

Get Curl error number

public getErrorNumber() : int
Return values
int

getHttpVersion()

Get the URI string

public getHttpVersion() : string
Return values
string

getInfo()

Get info about the Curl multi-handler

public getInfo() : array<string|int, mixed>|false
Return values
array<string|int, mixed>|false

getOption()

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>

getResponse()

Get Curl response

public getResponse() : mixed

getUri()

Get the URI string

public getUri() : string|null
Return values
string|null

hasClient()

Has Curl client

public hasClient(string $name) : bool
Parameters
$name : string
Return values
bool

hasOption()

Has a Curl option

public hasOption(int $opt) : bool
Parameters
$opt : int
Return values
bool

hasOptions()

Has Curl options

public hasOptions() : bool
Return values
bool

hasResource()

Determine whether or not resource is available

public hasResource() : bool
Return values
bool

hasResponse()

Has a Curl response

public hasResponse() : bool
Return values
bool

hasUri()

Determine whether or not there is a URI string

public hasUri() : bool
Return values
bool

isComplete()

Determine if the response is complete

public isComplete() : bool
Return values
bool

isError()

Determine if the response is an error

public isError([bool $strict = false ]) : bool|null
Parameters
$strict : bool = false
Return values
bool|null

isSuccess()

Determine if the response is a success

public isSuccess([bool $strict = true ]) : bool|null
Parameters
$strict : bool = true
Return values
bool|null

parseResponse()

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
throws
Exception
Return values
CurlMulti

resource()

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
int

setWait()

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
int

version()

Return the Curl version

public version() : array<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results