PHP code example of detain / myadmin-directadmin-storage

1. Go to this page and download the library: Download detain/myadmin-directadmin-storage library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

detain / myadmin-directadmin-storage example snippets


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);
}

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