REST
Less than 1 minute
REST
Properties
serverConfig
public Config $serverConfigclient
private Client $clientprotocol
private Protocol $protocolMethods
__construct
public __construct(array $serverConfig): voidParameters
| Parameter | Type | Description |
|---|---|---|
$serverConfig | array |
trigger
Triggers an event and sends the corresponding data.
public trigger(string $event, mixed $data, mixed $options, ?Response $response): boolParameters
| Parameter | Type | Description |
|---|---|---|
$event | string | the event identifier |
$data | mixed | The data to be sent with the event. Default is null. |
$options | mixed | Additional options for the event. Default is null. |
$response | Response |
send
Sends a request to the configured server.
private send(PacketType $type, mixed $data, mixed $options, ?Response $response): boolThis method constructs a URL based on the server configuration and sends a POST request with the specified type and data. It handles cases where the client server or port is not specified by defaulting to the server's listen address and port. Additionally, it sets up the authorization header if an admin key is provided.
Parameters
| Parameter | Type | Description |
|---|---|---|
$type | PacketType | the type of the request |
$data | mixed | The data to be sent with the request. Default is null. |
$options | mixed | Additional options for the request. Default is null. |
$response | Response |
Generated by Hazaar API Doc Generator on Mon, 27 Oct 2025 13:01:29 +0000