|
static | get_supported_versions () |
| Get the list of supported versions based on the available classes.
|
|
static | instance (string $serverurl, string $accesstoken,) |
| Return the versioned instance of the API.
|
|
|
| __construct (protected string $serverurl, protected string $accesstoken,) |
| Matrix events constructor to get the room id and refresh token usage if required.
|
|
| execute (command $command,) |
| Execute the specified command.
|
|
| get_client () |
| Helper to fetch the HTTP Client for the instance.
|
|
◆ __construct()
communication_matrix\matrix_client::__construct |
( |
protected string | $serverurl, |
|
|
protected string | $accesstoken ) |
|
protected |
Matrix events constructor to get the room id and refresh token usage if required.
- Parameters
-
string | $serverurl | The URL of the API server |
string | $accesstoken | The admin access token |
◆ execute()
communication_matrix\matrix_client::execute |
( |
command | $command | ) |
|
|
protected |
Execute the specified command.
- Parameters
-
- Return values
-
◆ get_client()
communication_matrix\matrix_client::get_client |
( |
| ) |
|
|
protected |
Helper to fetch the HTTP Client for the instance.
- Return values
-
◆ get_http_client()
static communication_matrix\matrix_client::get_http_client |
( |
| ) |
|
|
staticprotected |
Helper to fetch the HTTP Client.
- Return values
-
◆ get_server_url()
communication_matrix\matrix_client::get_server_url |
( |
| ) |
|
Get the URL of the server.
- Return values
-
◆ get_supported_features()
communication_matrix\matrix_client::get_supported_features |
( |
| ) |
|
Get a list of the features supported by this client.
- Return values
-
◆ get_supported_versions()
static communication_matrix\matrix_client::get_supported_versions |
( |
| ) |
|
|
static |
Get the list of supported versions based on the available classes.
- Return values
-
◆ get_token()
communication_matrix\matrix_client::get_token |
( |
| ) |
|
Get the current token in use.
- Return values
-
◆ get_version()
communication_matrix\matrix_client::get_version |
( |
| ) |
|
Get the API version of the current instance.
- Return values
-
◆ get_version_from_classname()
static communication_matrix\matrix_client::get_version_from_classname |
( |
string | $classname | ) |
|
|
staticprotected |
Normalise an API version from a classname.
- Parameters
-
string | $classname | The short classname, omitting any namespace or file extension |
- Return values
-
string | The normalised version |
◆ implements_feature()
communication_matrix\matrix_client::implements_feature |
( |
array|string | $feature | ) |
|
Determine if the API supports a feature.
If an Array is provided, this will return true if any of the specified features is implemented.
- Parameters
-
string[] | string | $feature | The feature to check. This is in the form of a namespaced class. |
- Return values
-
◆ instance()
static communication_matrix\matrix_client::instance |
( |
string | $serverurl, |
|
|
string | $accesstoken ) |
|
static |
Return the versioned instance of the API.
- Parameters
-
string | $serverurl | The URL of the API server |
string | $accesstoken | The admin access token to use |
- Return values
-
◆ meets_version()
communication_matrix\matrix_client::meets_version |
( |
string | $minversion | ) |
|
Check if the API version is at least the specified version.
- Parameters
-
string | $minversion | The minimum API version required |
- Return values
-
◆ query_server_supports()
static communication_matrix\matrix_client::query_server_supports |
( |
string | $serverurl | ) |
|
|
staticprotected |
Query the supported versions, and any unstable features, from the server.
Servers must implement the client versions API described here:
- Parameters
-
string | $serverurl | The server base |
- Return values
-
null|stdClass | The list of supported versions and a list of enabled unstable features |
◆ require_feature()
communication_matrix\matrix_client::require_feature |
( |
array|string | $feature | ) |
|
Require that the API supports a feature.
If an Array is provided, this is treated as a require any of the features.
- Parameters
-
string[] | string | $feature | The feature to test |
- Exceptions
-
◆ require_features()
communication_matrix\matrix_client::require_features |
( |
array | $features | ) |
|
Require that the API supports a list of features.
All features specified will be required.
If an array is provided as one of the features, any of the items in the nested array will be required.
- Parameters
-
string[] | array[] | $features | The list of features required |
Here is an example usage: $matrixapi->require_features([
communication_matrix::local::spec::features::create_room::class,
[
communication_matrix::local::spec::features::get_room_info_v1::class,
communication_matrix::local::spec::features::get_room_info_v2::class,
]
])
◆ requires_version()
communication_matrix\matrix_client::requires_version |
( |
string | $minversion | ) |
|
Assert that the API version is at least the specified version.
- Parameters
-
string | $minversion | The minimum API version required |
- Exceptions
-
◆ $client
$serverurl The URL of the home server
$accesstoken The access token of the matrix server The client to use
The documentation for this class was generated from the following file:
- communication/provider/matrix/classes/matrix_client.php