From: Bram Matthys Date: Wed, 12 Apr 2023 06:31:52 +0000 (+0200) Subject: Add $rpc->stats()->get(); X-Git-Url: https://jfr.im/git/irc/unrealircd/unrealircd-rpc-php.git/commitdiff_plain/1ef2e09fcc12f818c9aaf8e8ed186a451cb9003b?ds=sidebyside;hp=49faf2cf73ef44c01ef972a26f93525f6ec8e8ad Add $rpc->stats()->get(); --- diff --git a/lib/Connection.php b/lib/Connection.php index e5d5805..dcfb147 100644 --- a/lib/Connection.php +++ b/lib/Connection.php @@ -142,6 +142,11 @@ class Connection return new Rpc($this); } + public function stats(): Stats + { + return new Stats($this); + } + public function user(): User { return new User($this); @@ -161,18 +166,22 @@ class Connection { return new Spamfilter($this); } + public function nameban(): NameBan { return new NameBan($this); } + public function server(): Server { return new Server($this); } + public function serverbanexception(): ServerBanException { return new ServerBanException($this); } + public function log(): Log { return new Log($this); diff --git a/lib/Stats.php b/lib/Stats.php new file mode 100644 index 0000000..a4f5656 --- /dev/null +++ b/lib/Stats.php @@ -0,0 +1,29 @@ +connection = $conn; + } + + /** + * Get basic statistical information: user counts, channel counts, etc. + * + * @return stdClass|array|bool + */ + public function get(int $object_detail_level=1): stdClass|array|bool + { + $response = $this->connection->query('stats.get', [ + 'object_detail_level' => $object_detail_level, + ]); + } +}