A MyAdmin plugin that provides backup storage management through the DirectAdmin control panel API. This package handles the full lifecycle of DirectAdmin storage accounts including provisioning, suspension, reactivation, and termination.
- Account Provisioning - Automatically creates DirectAdmin user or reseller accounts for backup storage
- Suspension / Reactivation - Suspends and unsuspends accounts via the DirectAdmin API
- Termination - Cleanly removes accounts when services are cancelled
- IP Management - Supports changing IP addresses on existing accounts
- Hook-based Architecture - Integrates with MyAdmin's Symfony EventDispatcher-based plugin system
- HTTPSocket Client - Includes a curl-based HTTP client tailored for DirectAdmin API communication
- PHP >= 5.0
- ext-curl
- Symfony EventDispatcher ^5.0
composer require detain/myadmin-directadmin-storageThe plugin registers itself with MyAdmin's event system. Hook registration is handled automatically:
use Detain\MyAdminDirectAdminStorage\Plugin;
// Get all event hooks this plugin provides
$hooks = Plugin::getHooks();
// Register hooks with the event dispatcher
foreach ($hooks as $event => $callable) {
$dispatcher->addListener($event, $callable);
}The HTTPSocket class can also be used standalone for DirectAdmin API calls:
use Detain\MyAdminDirectAdminStorage\HTTPSocket;
$sock = new HTTPSocket();
$sock->connect('ssl://your-server.com', 2222);
$sock->set_login('admin', 'your-api-key');
$sock->query('/CMD_API_SHOW_ALL_USERS');
$users = $sock->fetch_parsed_body();composer install
vendor/bin/phpunitTo generate a coverage report:
vendor/bin/phpunit --coverage-textFor DirectAdmin API documentation, see:
- https://www.directadmin.com/api.php
- HTTPSocket originally from http://files.directadmin.com/services/all/httpsocket/httpsocket.php
This package is licensed under the LGPL-2.1.