NativeCurlClient
in package
implements
CurlClientInterface
Native cURL adapter backed by PHP's curl_* functions.
Table of Contents
Interfaces
- CurlClientInterface
- Adapter contract for cURL operations used by CurlHttpTransport.
Methods
- close() : void
- Closes a cURL handle.
- error() : string
- Returns the latest cURL error string.
- exec() : string|false
- Executes the cURL request.
- getInfo() : mixed
- Returns cURL transfer information.
- init() : mixed
- Initializes a new cURL handle.
- setOpt() : bool
- Sets a cURL option.
- setOptArray() : bool
- Sets multiple cURL options.
Methods
close()
Closes a cURL handle.
public
close(mixed $handle) : void
Parameters
- $handle : mixed
-
cURL handle.
error()
Returns the latest cURL error string.
public
error(mixed $handle) : string
Parameters
- $handle : mixed
-
cURL handle.
Return values
stringexec()
Executes the cURL request.
public
exec(mixed $handle) : string|false
Parameters
- $handle : mixed
-
cURL handle.
Return values
string|falsegetInfo()
Returns cURL transfer information.
public
getInfo(mixed $handle, int $option) : mixed
Parameters
- $handle : mixed
-
cURL handle.
- $option : int
init()
Initializes a new cURL handle.
public
init() : mixed
Return values
mixed —cURL handle or false on failure.
setOpt()
Sets a cURL option.
public
setOpt(mixed $handle, int $option, mixed $value) : bool
Parameters
- $handle : mixed
-
cURL handle.
- $option : int
- $value : mixed
-
Option value.
Return values
boolsetOptArray()
Sets multiple cURL options.
public
setOptArray(mixed $handle, array<string|int, mixed> $options) : bool
Parameters
- $handle : mixed
-
cURL handle.
- $options : array<string|int, mixed>
-
cURL options map.