承接 mvdgeijn/directadmin 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mvdgeijn/directadmin

最新稳定版本:v0.24.0

Composer 安装命令:

composer require mvdgeijn/directadmin

包简介

PHP client library to manage DirectAdmin control panel servers.

README 文档

README

Build Status Coverage Status Scrutinizer GitHub 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.

21-3-2022: Moved to mvdgeijn/directadmin, as omines/directadmin is abandoned and we needed more API implementations.

API documentation for this project is automatically generated on each push.

Installation

Packagist Packagist

The recommended way to install this library is through Composer:

composer require mvdgeijn/directadmin

If you're not familiar with composer follow the installation instructions for Linux/Unix/Mac or Windows, and then read the basic usage introduction.

Dependencies

The library uses Guzzle 7 as its HTTP communication layer. PHP versions supported are 7.0, 7.1, 8.0, 8.1 and hhvm.

Basic usage

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

use Mvdgeijn\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, ResellerContext, and UserContext 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 instance in the context of its owning user, allowing you to manage its email accounts et al transparently.

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

This software was developed for internal use at Omines Full Service Internetbureau 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.

统计信息

  • 总下载量: 7.8k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 1
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-03-21