PHPackages                             knik/gameap-daemon-client - 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. knik/gameap-daemon-client

ActiveLibrary

knik/gameap-daemon-client
=========================

GameAP Daemon PHP Client

0.6.6(3y ago)07.4k—0%4MITPHPPHP &gt;=7.2

Since Nov 12Pushed 3y agoCompare

[ Source](https://github.com/et-nik/gameap-daemon-client)[ Packagist](https://packagist.org/packages/knik/gameap-daemon-client)[ RSS](/packages/knik-gameap-daemon-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (23)Used By (4)

GameAP Daemon Client
====================

[](#gameap-daemon-client)

[![Build Status](https://camo.githubusercontent.com/62d45532ed852c92e13fdb2917a9f356cbb12383b3960f167fd2637dd298d283/68747470733a2f2f7472617669732d63692e636f6d2f65742d6e696b2f67616d6561702d6461656d6f6e2d636c69656e742e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/et-nik/gameap-daemon-client)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/2bc36dca69c4db1cf88e0d5b1a5dfcb3d44cad6f405a71e07f1a74ea3b192937/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f65742d6e696b2f67616d6561702d6461656d6f6e2d636c69656e742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/et-nik/gameap-daemon-client/?branch=master)[![Coverage Status](https://camo.githubusercontent.com/aa2b5c2ac8d9d68eafd17fb2b77995dc359096c43c551b5ac31c1884ba05c21d/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f65742d6e696b2f67616d6561702d6461656d6f6e2d636c69656e742f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/et-nik/gameap-daemon-client/code-structure)

- [Installation](#installation)
- [Usage](#usage)
    - [Commands](#commands)
        - [Connect to server](#connect-to-server)
        - [Execute command](#execute-command)
    - [Files](#files)
        - [Connect to server](#connect-to-server-1)
        - [Listing directory](#listing-directory)
            - [Detail info about files](#detail-info-about-files)
            - [File names only](#file-names-only)
        - [Create directory](#create-directory)
        - [Remove](#remove)
        - [Move/Rename](#rename)
        - [Copy](#copy)
        - [Change permission](#change-permission)
        - [Exist checking](#exist-checking)
        - [Metadata](#metadata)
        - [Download file from server](#download-file-from-server)
        - [Upload file](#upload-file)
    - [Status](#status)
        - [Connect to server](#connect-to-server-2)
        - [GameAP Daemon Version](#gameap-daemon-version)
        - [Base Information](#base-information)
        - [Details Information](#details-information)

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

[](#installation)

```
composer require knik/gameap-daemon-client
```

Usage
-----

[](#usage)

### Commands

[](#commands)

#### Connect to server

[](#connect-to-server)

```
$gdaemonCommands = new GdaemonCommands([
    'host' => 'localhost',
    'port' => 31717,
    'serverCertificate' => '/path/to/server.crt',
    'localCertificate' => '/path/to/client.crt',
    'privateKey' => '/path/to/client.key.pem',
    'privateKeyPass' => '1234',
    'timeout' => 10,
    'workDir' => '/home/user',
]);

$gdaemonCommands->connect();
```

#### Execute command

[](#execute-command)

```
$result = $gdaemonCommands->exec('echo HELLO');
var_dump($result); // string(5) "HELLO"
```

Exit code:

```
$result = $gdaemonCommands->exec('echo HELLO', $exitCode);
var_dump($result); // string(5) "HELLO"
var_dump($exitCode); // int(0)
```

### Files

[](#files)

#### Connect to server

[](#connect-to-server-1)

```
$gdaemonFiles = new GdaemonFiles([
    'host' => 'localhost',
    'port' => 31717,
    'serverCertificate' => '/path/to/server.crt',
    'localCertificate' => '/path/to/client.crt',
    'privateKey' => '/path/to/client.key.pem',
    'privateKeyPass' => '1234',
    'timeout' => 10,
]);

$gdaemonFiles->connect();
```

#### Listing directory

[](#listing-directory)

##### Detail info about files

[](#detail-info-about-files)

```
$result = $gdaemonFiles->directoryContents('/path/to/dir');

print_r($result);
/*
Array
(
    [0] => Array
       (
           [name] => directory
           [size] => 0
           [mtime] => 1542013640
           [type] => dir
           [permissions] => 0755
       )

    [1] => Array
       (
           [name] => file.txt
           [size] => 15654
           [mtime] => 1542013150
           [type] => file
           [permissions] => 0644
       )

)

*/
```

##### File names only

[](#file-names-only)

```
$result = $gdaemonFiles->listFiles('/path/to/dir');

print_r($result);
Array
(
    [0] => directory
    [1] => file.txt
)
```

#### Create directory

[](#create-directory)

```
$gdaemonFiles->mkdir('/path/to/new_dir');
```

#### Remove

[](#remove)

```
$gdaemonFiles->delete('/path/to/file.txt');
```

To remove a directory that contains other files or directories:

```
$gdaemonFiles->delete('/path/to/file.txt', true);
```

#### Rename

[](#rename)

Rename or move files/directories

```
$gdaemonFiles->rename('/path/to/file.txt', '/path/to/new_name.txt');
```

#### Copy

[](#copy)

```
$gdaemonFiles->copy('/path/to/file.txt', '/path/to/new_file.txt');
```

#### Change permission

[](#change-permission)

```
$gdaemonFiles->chmod(0755, '/path/to/file.txt');
```

#### Exist checking

[](#exist-checking)

```
$gdaemonFiles->exist('/path/to/file.txt');
```

#### Metadata

[](#metadata)

```
$result = $gdaemonFiles->directoryContents('/path/to/file.txt');

print_r($result);
/*
Array
(
    [name] => file.txt
    [size] => 43
    [type] => file
    [mtime] => 1541971363
    [atime] => 1541971363
    [ctime] => 1541971363
    [permissions] => 0644
    [mimetype] => text/plain
)
*/
```

#### Download file from server

[](#download-file-from-server)

```
$gdaemonFiles->get('/remote/path/to/file.txt', '/local/path/to/file.txt');
```

File handle:

```
$fileHandle = fopen('php://temp', 'w+b');
$gdaemonFiles->get('/remote/path/to/file.txt', $fileHandle);
```

#### Upload file

[](#upload-file)

```
$gdaemonFiles->put('/local/path/to/file.txt', '/remote/path/to/file.txt');
```

File handle:

```
$fileHandle = fopen('/local/path/to/file.txt', 'r');
$gdaemonFiles->put($fileHandle, '/remote/path/to/file.txt');
```

### Status

[](#status)

#### Connect to server

[](#connect-to-server-2)

```
$gdaemonStatus = new GdaemonStatus([
    'host' => 'localhost',
    'port' => 31717,
    'serverCertificate' => '/path/to/server.crt',
    'localCertificate' => '/path/to/client.crt',
    'privateKey' => '/path/to/client.key.pem',
    'privateKeyPass' => '1234',
    'timeout' => 10,
]);

$gdaemonStatus->connect();
```

#### GameAP Daemon Version

[](#gameap-daemon-version)

Get GameAP Daemon version and compilation date

```
$version = $gdaemonStatus->version();
```

#### Base Information

[](#base-information)

Get uptime info, number of working and waiting tasks, number of online servers list

```
$info = $gdaemonStatus->infoBase();
```

#### Details Information

[](#details-information)

Get uptime info, ID list of working and waiting tasks, ID list of online servers list

```
$info = $gdaemonStatus->infoDetails();
```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

###  Release Activity

Cadence

Every ~77 days

Recently: every ~127 days

Total

22

Last Release

1105d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d7469ba20a83b18557bde2a09acd47b9b0ee91657f73b35789c5367fbe94dd19?d=identicon)[knik](/maintainers/knik)

---

Top Contributors

[![et-nik](https://avatars.githubusercontent.com/u/3670640?v=4)](https://github.com/et-nik "et-nik (38 commits)")

---

Tags

gameap

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/knik-gameap-daemon-client/health.svg)

```
[![Health](https://phpackages.com/badges/knik-gameap-daemon-client/health.svg)](https://phpackages.com/packages/knik-gameap-daemon-client)
```

PHPackages © 2026

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