Skip to content

FirstOrDefault/directapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DirectApi

DirectApi is a wrapper for the DirectAdmin API.

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

Installation

Use the package manager composer to install DirectApi.

composer require avametix/directapi

Usage

use Avametix\DirectApi;

// Create a new DirectApi instance logged in with user "username" and password "password"
$directapi = new DirectApi(
    'da.domain.io',
    'username',
    'password',
    'https',
    2222
);

// Get user domains
$domains = $directapi->get_api("SHOW_DOMAINS");

if ($domains === false) {
    die(
        "Something went wrong fetching domains for username,<br/>
        are you using the right password?"
        );
}

foreach ($domain in $domains) {
    echo $domain . "<br/>";
}

// Log-in as user via reseller (directapi is initialised with reseller or admin login)
$directapi->login_as('clientuser');

// ...

$directapi->logout();

All DirectAdmin API commands can be found in the DirectAdmin documentation.

Contributing

Contributions are primarily made by members of Avametix, however pull requests are welcome. Planning a major change? Please open an issue first and discuss your changes.

License

GNU General Public License

About

DirectApi is a wrapper for the DirectAdmin API to allow for easy communication between the DirectAdmin installation and your dynamic websites.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages