https://github.com/opengsq/opengsq-php
PHP library designed for querying game servers. It supports 4 different query protocols.
https://github.com/opengsq/opengsq-php
game game-server-query opengsq php server-query
Last synced: about 1 year ago
JSON representation
PHP library designed for querying game servers. It supports 4 different query protocols.
- Host: GitHub
- URL: https://github.com/opengsq/opengsq-php
- Owner: opengsq
- License: mit
- Created: 2024-01-18T02:36:00.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-24T17:26:32.000Z (about 2 years ago)
- Last Synced: 2024-04-24T19:31:18.047Z (about 2 years ago)
- Topics: game, game-server-query, opengsq, php, server-query
- Language: PHP
- Homepage: https://php.opengsq.com/
- Size: 13.2 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# OpenGSQ PHP Library
[](https://github.com/opengsq/opengsq-php/actions/workflows/php.yml)
[](https://github.com/opengsq/opengsq-php/blob/main/LICENSE)
[](https://packagist.org/packages/opengsq/opengsq-php)
[](https://packagist.org/packages/opengsq/opengsq-php)
The OpenGSQ PHP library provides a convenient way to query servers from applications written in the PHP language.
## Documentation
Detailed documentation is available at [https://php.opengsq.com](https://php.opengsq.com).
## System Requirements
- [PHP 8.1.2](https://www.php.net) or higher
## Installation
The recommended way to install the OpenGSQ PHP library is through Composer, a tool for dependency management in PHP. You can install it by running the following command in your terminal:
```sh
composer require opengsq/opengsq-php
```
## Basic Usage
Here’s a quick example of how you can use the OpenGSQ library to query a server using the VCMP protocol:
```php
getStatus();
// Output the status information
var_dump($status);
// Get the players on the server
$players = $vcmp->getPlayers();
// Output the player information
var_dump($players);
```
In this example, we first include the Composer autoloader and import the `Vcmp` class. We then create a new `Vcmp` object, specifying the host and port of the server we want to query. Finally, we call the `getStatus` and `getPlayers` methods to retrieve and output information about the server and its players.
## License
This project is licensed under the MIT License. See the [LICENSE](https://github.com/opengsq/opengsq-php/blob/main/LICENSE) file for details.
## Stargazers over time
[](https://starchart.cc/opengsq/opengsq-php)