detain/myadmin-directadmin-storage

DirectAdmin Storage Plugin for MyAdmin - provides backup storage management via the DirectAdmin API

Maintainers

Package info

github.com/myadmin-plugins/directadmin-storage

Type:myadmin-plugin

pkg:composer/detain/myadmin-directadmin-storage

Statistics

Installs: 182

Dependents: 0

Suggesters: 0

Stars: 2

Open Issues: 0

v1.0.0 2020-08-07 23:50 UTC

This package is auto-updated.

Last update: 2026-03-19 15:56:39 UTC


README

Tests codecov

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.

Features

  • 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

Requirements

  • PHP >= 5.0
  • ext-curl
  • Symfony EventDispatcher ^5.0

Installation

composer require detain/myadmin-directadmin-storage

Usage

The 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();

Running Tests

composer install
vendor/bin/phpunit

To generate a coverage report:

vendor/bin/phpunit --coverage-text

API Reference

For DirectAdmin API documentation, see:

License

This package is licensed under the LGPL-2.1.