PHPackages                             clancats/sourcequery - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. clancats/sourcequery

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

clancats/sourcequery
====================

A PHP library to query a Source game server (Counter Strike, Half Life, Team Fortress ect. )

224PHP

Since Feb 27Pushed 11y ago1 watchersCompare

[ Source](https://github.com/mario-deluna/SourceQuery)[ Packagist](https://packagist.org/packages/clancats/sourcequery)[ RSS](/packages/clancats-sourcequery/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

SourceQuery
===========

[](#sourcequery)

[![Build Status](https://camo.githubusercontent.com/e19aeff2f1d69ad412b20163319bca924f9598069a59e09b9f97d83182bc7341/68747470733a2f2f7472617669732d63692e6f72672f6d6172696f2d64656c756e612f536f7572636551756572792e737667)](https://travis-ci.org/mario-deluna/SourceQuery)

This is a fork of the original [SourceQuery by Yannickcr](https://github.com/yannickcr/SourceQuery).

This little PHP library helps to query a [Source engine](http://en.wikipedia.org/wiki/Source_%28game_engine%29) server for games like:

- Counter Strike Source
- Team Fortress
- Left 4 Dead
- Garrys Mod
- and many more..

Installation
------------

[](#installation)

Simply add the mario-deluna/sourcequery to you composer requirements.

```
"require":
{
	"mario-deluna/sourcequery": "dev-master"
}
```

How to use
----------

[](#how-to-use)

### Example

[](#example)

```
$client = new SourceQuery\Client( '127.0.0.1', 27015 );

// print the name of the server
echo $client->server()->name;
```

### The server object

[](#the-server-object)

```
$server = $client->server();

/*
 * byte 	Protocol version used by the server.
 */
$server->protocol;

/*
 * string	Name of the server.
 */
$server->name;

/*
 * string	Map the server has currently loaded.
 */
$server->map;

/*
 * string	Name of the folder containing the game files.
 */
$server->folder;

/*
 * string	Full name of the game.
 * Don't get confused this is the name of the gamemode.
 */
$server->game;

/*
 * short	Steam Application ID of game.
 */
$server->id;

/*
 * int		Number of players on the server.
 */
$server->playerCount;

/*
 * int		Maximum number of players the server reports it can hold.
 */
$server->maxPlayerCount;

/*
 * int		Number of bots on the server.
 */
$server->botsCount;

/*
 * string 	Indicates the type of server:
 *  'd' for a dedicated server
 *  'l' for a non-dedicated server
 *  'p' for a SourceTV relay (proxy)
 */
$server->serverType;

/*
 * string 	Same as server type but return the full string
 */
$server->serverTypeFull;

/*
 * string	Indicates the operating system of the server:
 *  'l' for Linux
 *  'w' for Windows
 *  'm' or 'o' for Mac (the code changed after L4D1)
 */
$server->environment;

/*
 * bool 	Indicates whether the server requires a password:
 *  false for public
 *  true for private
 */
$server->password;

/*
 * bool 	Specifies whether the server uses VAC:
 *  false for unsecured
 *  true for secured
 */
$server->vac;
```

Notes:
------

[](#notes)

- For more informations, please read the [Server queries documentation](http://developer.valvesoftware.com/wiki/Server_queries)

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1b22b6cd3db7191046069cd7dd954e97585d9de1901403f8394c7eb7ae77056e?d=identicon)[clancats](/maintainers/clancats)

---

Top Contributors

[![mario-deluna](https://avatars.githubusercontent.com/u/956212?v=4)](https://github.com/mario-deluna "mario-deluna (15 commits)")[![de-salvatierra](https://avatars.githubusercontent.com/u/5816848?v=4)](https://github.com/de-salvatierra "de-salvatierra (1 commits)")[![yannickcr](https://avatars.githubusercontent.com/u/13209?v=4)](https://github.com/yannickcr "yannickcr (1 commits)")

### Embed Badge

![Health badge](/badges/clancats-sourcequery/health.svg)

```
[![Health](https://phpackages.com/badges/clancats-sourcequery/health.svg)](https://phpackages.com/packages/clancats-sourcequery)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
