Matrix_client
extends HTTP_client
in package
A HTTP client based on CURL.
Table of Contents
Properties
Methods
- __construct() : mixed
- The main class constructor.
- __destruct() : mixed
- The main class destructor that closes the current CURL session.
- get() : HTTP|mixed
- Make an HTTP GET request.
- get_domain() : Domain
- Get domain name from the server URL.
- get_port() : Port
- Get server port from the URL.
- get_server() : HTTP
- Get the current server.
- handle_result() : mixed
- post() : HTTP|mixed
- Make an HTTP POST request.
- post_file() : bool|mixed|string
- Post a file to a server.
- put() : HTTP|mixed
- Make an HTTP PUT request.
- set_debug_mode() : void
- Set Curl debug mode to $value.
- get_curl() : mixed
- Get Curl handle.
- set_opt() : void
- Set Curl option.
Properties
$curl
A CURL instance.
private
mixed
$curl
$server
Server URL.
private
mixed
$server
Methods
__construct()
The main class constructor.
public
__construct( $server_location) : mixed
Parameters
__destruct()
The main class destructor that closes the current CURL session.
public
__destruct() : mixed
get()
Make an HTTP GET request.
public
get(string $resource[, array<string|int, mixed> $params = [] ]) : HTTP|mixed
Parameters
- $resource : string
- $params : array<string|int, mixed> = []
Tags
Return values
HTTP|mixedget_domain()
Get domain name from the server URL.
public
get_domain() : Domain
Return values
Domain —name as a string.
get_port()
Get server port from the URL.
public
get_port() : Port
Return values
Port —number;
get_server()
Get the current server.
public
get_server() : HTTP
Return values
HTTP —server link as a string.
handle_result()
public
handle_result( $result) : mixed
Parameters
Tags
post()
Make an HTTP POST request.
public
post(string $resource, $data[, array<string|int, mixed> $params = [] ][, $_ = null ]) : HTTP|mixed
Parameters
Tags
Return values
HTTP|mixedpost_file()
Post a file to a server.
public
post_file(string $resource, string $file_path[, array<string|int, mixed> $params = [] ][, array<string|int, mixed> $headers = [] ]) : bool|mixed|string
Parameters
- $resource : string
- $file_path : string
- $params : array<string|int, mixed> = []
- $headers : array<string|int, mixed> = []
Tags
Return values
bool|mixed|stringput()
Make an HTTP PUT request.
public
put(string $resource, $data[, array<string|int, mixed> $params = [] ][, $_ = null ]) : HTTP|mixed
Parameters
Tags
Return values
HTTP|mixedset_debug_mode()
Set Curl debug mode to $value.
public
set_debug_mode(bool $is_enabled) : void
Parameters
- $is_enabled : bool
-
Is debug mode enabled?
get_curl()
Get Curl handle.
protected
get_curl() : mixed
Return values
mixed —Curl handle.
set_opt()
Set Curl option.
protected
set_opt(int $option, $value) : void