]>
Commit | Line | Data |
---|---|---|
c6e7dd34 BM |
1 | <?php |
2 | ||
3 | namespace UnrealIRCd; | |
4 | ||
5 | use Exception; | |
6 | use stdClass; | |
7 | ||
8 | class Rpc | |
9 | { | |
10 | ||
11 | public Connection $connection; | |
12 | ||
13 | public function __construct(Connection $conn) | |
14 | { | |
15 | $this->connection = $conn; | |
16 | } | |
17 | ||
18 | /** | |
19 | * Get information on all RPC modules loaded. | |
20 | * | |
21 | * @return stdClass|array|bool | |
22 | */ | |
23 | public function info(string $nick, string $reason): stdClass|array|bool | |
24 | { | |
25 | return $this->connection->query('rpc.info'); | |
26 | } | |
27 | ||
28 | /** | |
29 | * Set the name of the issuer that will make all the following RPC request | |
30 | * (eg. name of logged in user on a webpanel). Requires UnreaIRCd 6.0.8+. | |
31 | * @return stdClass|array|bool | |
32 | */ | |
33 | public function set_issuer(string $name): stdClass|array|bool | |
34 | { | |
35 | return $this->connection->query('rpc.set_issuer', [ | |
36 | 'name' => $name, | |
37 | ]); | |
38 | } | |
39 | } |