chillerlan / php-teamspeak
PHP7.4+ 简单的 Teamspeak3 查询客户端
1.0.0
2021-05-15 12:50 UTC
Requires
- php: ^7.4 || ^8.0
- ext-json: *
- chillerlan/php-settings-container: ^2.1
- psr/log: ^1.1
Requires (Dev)
- chillerlan/php-dotenv: ^2.1
- phan/phan: ^4.0
- phpunit/phpunit: ^9.5
README
PHP7.4+ 的简单 TS3 查询客户端。
文档
安装
需要 composer
composer.json (注意:将 dev-main
替换为一个 版本边界)
{ "require": { "php": "^7.4 || ^8.0", "chillerlan/php-teamspeak": "dev-main" } }
利润!
用法
use chillerlan\Teamspeak\{TS3Config, TS3Client}; $options = new TS3Config([ 'host' => 'localhost', 'port' => 10011, 'vserver' => 1, 'query_user' => 'query', 'query_password' => 'supersecretpassword', 'minLogLevel' => 'debug', ]); $ts3 = new TS3Client($options); $ts3->connect(); $serverInfo = $ts3->send('serverinfo'); var_dump($serverInfo->parseList()); $channelList = $ts3->send('channellist', ['topic', 'limits', 'flags', 'voice', 'icon', 'secondsempty']); var_dump($channelList->parseList()); $clientList = $ts3->send('clientlist', ['uid', 'away', 'voice', 'times', 'groups', 'info', 'icon', 'country']); var_dump($clientList->parseList()); // ...