PHPackages                             hieupt7/directadmin - 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. [API Development](/categories/api)
4. /
5. hieupt7/directadmin

ActiveLibrary[API Development](/categories/api)

hieupt7/directadmin
===================

PHP client library to manage DirectAdmin control panel servers.

v1.0.3(6y ago)09MITPHPPHP &gt;=5.6.0CI failing

Since Oct 12Pushed 5y ago1 watchersCompare

[ Source](https://github.com/HieuPT7/directadmin)[ Packagist](https://packagist.org/packages/hieupt7/directadmin)[ Docs](https://github.com/hieupt7/directadmin)[ RSS](/packages/hieupt7-directadmin/feed)WikiDiscussions master Synced yesterday

READMEChangelog (4)Dependencies (4)Versions (5)Used By (0)

DirectAdmin API client
======================

[](#directadmin-api-client)

[![Build Status](https://camo.githubusercontent.com/1af90a3e9ac5e16355142e616a0e6baaccb20d63468b5d8a31b5ac79d5faa2ca/68747470733a2f2f7472617669732d63692e6f72672f6f6d696e65732f64697265637461646d696e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/omines/directadmin)[![Coverage Status](https://camo.githubusercontent.com/ec1ad25970cae5859bdc89240b736f314f8270b96febfd1b6d9acc10fcb2d89a/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6f6d696e65732f64697265637461646d696e2f62616467652e7376673f6272616e63683d6d617374657226736572766963653d676974687562)](https://coveralls.io/github/omines/directadmin?branch=master)[![Scrutinizer](https://camo.githubusercontent.com/82ae8106e742d7b03c982af6a370f32a4838130c50be30da53bbd789b77fc8a7/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6f6d696e65732f64697265637461646d696e2e737667)](https://scrutinizer-ci.com/g/omines/directadmin/?branch=master)[![SensioLabs Insight](https://camo.githubusercontent.com/4d29ccc1610ff7ebdc0315fdde2f9856d18e9c68ccd1741ddef6b34831840dfc/68747470733a2f2f696d672e736869656c64732e696f2f73656e73696f6c6162732f692f34376137313230342d663237342d343431362d396462312d3937373364363538343563612e737667)](https://insight.sensiolabs.com/projects/47a71204-f274-4416-9db1-9773d65845ca)[![GitHub license](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](https://raw.githubusercontent.com/omines/directadmin/master/LICENSE)

This is a PHP client library to manage DirectAdmin control panel servers. We simply decided to develop this as we needed automation of our own DirectAdmin servers, and the existing implementations were unsupported and incomplete.

[API documentation for this project is automatically generated on each push](https://hieupt7.github.io/directadmin/api/).

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

[](#installation)

[![Packagist](https://camo.githubusercontent.com/687911181b0c2ac308693aa913771994a2ac0eefb1fbcb371b15d64039b64cc6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f6d696e65732f64697265637461646d696e2e737667)](https://packagist.org/packages/hieupt7/directadmin)[![Packagist](https://camo.githubusercontent.com/ce1a0d09ce063931a3777f4622f6d876e4c80038517c0ff7c1fd67ef7f52d9cf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f767072652f6f6d696e65732f64697265637461646d696e2e737667)](https://packagist.org/packages/omines/directadmin#dev-master)

The recommended way to install this library is through [Composer](http://getcomposer.org):

```
composer require hieupt7/directadmin
```

If you're not familiar with `composer` follow the installation instructions for [Linux/Unix/Mac](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx) or [Windows](https://getcomposer.org/doc/00-intro.md#installation-windows), and then read the [basic usage introduction](https://getcomposer.org/doc/01-basic-usage.md).

Dependencies
------------

[](#dependencies)

The library uses [Guzzle 6](https://github.com/guzzle/guzzle) as its HTTP communication layer. PHP versions supported are 5.6, 7.0, 7.1 and hhvm.

Basic usage
-----------

[](#basic-usage)

To set up the connection use one of the base functions:

```
use Omines\DirectAdmin\DirectAdmin;

$adminContext = DirectAdmin::connectAdmin('http://hostname:2222', 'admin', 'pass');
$resellerContext = DirectAdmin::connectReseller('http://hostname:2222', 'reseller', 'pass');
$userContext = DirectAdmin::connectUser('http://hostname:2222', 'user', 'pass');
```

These functions return an [`AdminContext`](https://hieupt7.github.io/directadmin/api/class-Omines.DirectAdmin.Context.AdminContext.html), [`ResellerContext`](https://hieupt7.github.io/directadmin/api/class-Omines.DirectAdmin.Context.ResellerContext.html), and [`UserContext`](https://hieupt7.github.io/directadmin/api/class-Omines.DirectAdmin.Context.UserContext.html)respectively exposing the functionality available at the given level. All three extend eachother as DirectAdmin uses a strict is-a model. To act on behalf of a user you can use impersonation calls:

```
$resellerContext = $adminContext->impersonateReseller($resellerName);
$userContext = $resellerContext->impersonateUser($userName);
```

Both are essentially the same but mapped to the correct return type. Impersonation is also done implicitly when managing a user's domains:

```
$domain = $adminContext->getUser('user')->getDomain('example.tld');
```

This returns, if the domain exists, a [`Domain`](https://hieupt7.github.io/directadmin/api/class-Omines.DirectAdmin.Objects.Domain.html)instance in the context of its owning user, allowing you to manage its email accounts et al transparently.

Contributions
-------------

[](#contributions)

As the DirectAdmin API keeps expanding pull requests are welcomed, as are requests for specific functionality. Pull requests should in general include proper unit tests for the implemented or corrected functions.

For more information about unit testing see the `README.md` in the tests folder.

Legal
-----

[](#legal)

This software was developed for internal use at [Omines Full Service Internetbureau](https://www.omines.nl/)in Eindhoven, the Netherlands. It is shared with the general public under the permissive MIT license, without any guarantee of fitness for any particular purpose. Refer to the included `LICENSE` file for more details.

The project is not in any way affiliated with JBMC Software or its employees.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

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 ~22 days

Total

4

Last Release

2337d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0a0a05d265db7d2ce7afec141b30a20abce10c5b00156586c5bff5ed16ebf2f3?d=identicon)[HTLove](/maintainers/HTLove)

---

Top Contributors

[![HieuPT7](https://avatars.githubusercontent.com/u/8587251?v=4)](https://github.com/HieuPT7 "HieuPT7 (13 commits)")

---

Tags

phpapilibrarydirectadmincontrol paneldirect admin

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/hieupt7-directadmin/health.svg)

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

###  Alternatives

[checkout/checkout-sdk-php

Checkout.com SDK for PHP

553.3M7](/packages/checkout-checkout-sdk-php)[getjump/vk

Library for work with API Vk.com

20048.5k](/packages/getjump-vk)[fabian-beiner/todoist-php-api-library

A PHP client library that provides a native interface to the official Todoist REST API.

4810.8k](/packages/fabian-beiner-todoist-php-api-library)

PHPackages © 2026

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