prestige-solution / ts-x-php-framework
Modern use-at-will framework that provides individual components to manage Teamspeak Server Instances
Requires
- php: ^8.2
- ext-ctype: *
- ext-json: *
- ext-mbstring: *
- ext-openssl: *
- ext-ssh2: *
- phpseclib/phpseclib: ^3.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.6
- php-coveralls/php-coveralls: ^2.5
- phpcompatibility/php-compatibility: ^9.3
- phpunit/phpunit: ^11.0
- react/socket: ^1.11
- squizlabs/php_codesniffer: ^3.11
- symfony/yaml: ^7.0
This package is auto-updated.
Last update: 2025-05-19 19:43:18 UTC
README
The X stand for a non-specific Teamspeak Version. So we would handle all current and future Versions from a Teamspeak Server.
Unfortunately, the original repository is no longer up to date and has not been maintained for 3 years. This is the reason why this project is being created.
The main goal is to bring the framework up to date and to equip it with extended unit tests which can also be carried out with a live server.
The ideal is that this version can be integrated into your own project and the main functionalities can be tested with your Teamspeak server.
Installation
We DON'T change the original Namespace from PlanetTeamspeak. So the replacement should not be affected your current Project.
PHP Required Extensions
apt install php8.2 php8.2-{common,mbstring,ssh2} -y
Via Composer
Current Version:
composer require prestige-solution/ts-x-php-framework
or with a specific release
composer require prestige-solution/ts-x-php-framework:2.0.0-beta-2
Via Git
Add to your composer.json
following options
"require": { "prestige-solution/ts-x-php-framework": "dev-main" }, "repositories": [{ "url": "https://github.com/Prestige-Solution/ts-x-php-framework.git", "type": "git" }],
New test routines for future developments and improvements
Prepare your Environment
Before you start, make sure that you have set the environment variables. You find more information's at testing-live-server
Servergroup Permissions for Query User
Use the Permissions which the query user is used. All tests will be use these Permissions to validate the functionalities.
Run Tests
To run all tests use composer test
.
Build Factory URI
Default URI Options
Options | Default Value |
---|---|
timeout | 10 |
blocking | 0 |
tls | 0 |
ssh | 0 |
If you build the serverquery without above parameters then there options will be set by default.
Note: don't set timeout to 0. Further Information's at php.net
Examples
- RAW Mode (stream_socket_client)
'serverquery://<user>:<password>@<host>:<query_port>/?server_port=<server_port>&ssh=0&no_query_clients=0&blocking=0&timeout=30&nickname=<bot_name>'
- SSH Mode (ssh2_shell)
'serverquery://<user>:<password>@<host>:<query_port>/?server_port=<server_port>&ssh=1&no_query_clients=0&blocking=0&timeout=30&nickname=<bot_name>'
- Contains Username or Password special chars like
+
then you can use
'serverquery://' . rawurlencode(<user>) . ':' . rawurlencode(<password>) .' @<host>:<query_port>/?server_port=<server_port>&ssh=1&no_query_clients=0&blocking=0&timeout=30&nickname=<bot_name>'
In my opinion you should don't use specials chars. Better, create a new QueryLogin Password and / or Username.
- You can use IPv4, IPv6 or DNS. Implement following Example in your Project.
if (filter_var($host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) || filter_var(gethostbyname($host), FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) { $validatedHost = $host; } elseif (filter_var($host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) || filter_var(gethostbyname($host), FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) { $validatedHost = '['.$host.']'; } else { return false; }
Current Milestones:
- Collect initial inspection and understanding of the source code
- Fix a few existing Unit Tests
- Rewrite source code up to PHP 8.2+
- Functionality tests of the framework
- Functionality tests for the bot identity
- Minimalistic testing with a Live Server or Development Server
- Bug fixes
- Search Bugs and fixes
- Full Testing with a Live Server or Development Server
- Readme and Documentations
Important note
We have no intention of abandoning the original repository altogether. We will keep the namespace so that an update to the original PlanetTeamspeak repository can be considered as far as possible and the Support from the Maintainer is back.