Overview
  • Namespace
  • Class

Namespaces

  • Omines
    • DirectAdmin
      • Context
      • Objects
        • Database
        • Domains
        • Email
        • Users
      • Utility

Classes

  • DirectAdmin

Exceptions

  • DirectAdminException

Class DirectAdmin

DirectAdmin API main class, encapsulating a specific account connection to a single server.

Namespace: Omines\DirectAdmin
Author: Niels Keurentjes niels.keurentjes@omines.com
Located at DirectAdmin/DirectAdmin.php

Methods summary

public static Omines\DirectAdmin\Context\AdminContext
# connectAdmin( string $url, string $username, string $password, boolean $validate = false )

Connects to DirectAdmin with an admin account.

Connects to DirectAdmin with an admin account.

Parameters

$url
The base URL of the DirectAdmin server
$username
The username of the account
$password
The password of the account
$validate
Whether to ensure the account exists and is of the correct type

Returns

Omines\DirectAdmin\Context\AdminContext
public static Omines\DirectAdmin\Context\ResellerContext
# connectReseller( string $url, string $username, string $password, boolean $validate = false )

Connects to DirectAdmin with a reseller account.

Connects to DirectAdmin with a reseller account.

Parameters

$url
The base URL of the DirectAdmin server
$username
The username of the account
$password
The password of the account
$validate
Whether to ensure the account exists and is of the correct type

Returns

Omines\DirectAdmin\Context\ResellerContext
public static Omines\DirectAdmin\Context\UserContext
# connectUser( string $url, string $username, string $password, boolean $validate = false )

Connects to DirectAdmin with a user account.

Connects to DirectAdmin with a user account.

Parameters

$url
The base URL of the DirectAdmin server
$username
The username of the account
$password
The password of the account
$validate
Whether to ensure the account exists and is of the correct type

Returns

Omines\DirectAdmin\Context\UserContext
protected
# __construct( string $url, string $username, string $password )

Creates a connection wrapper to DirectAdmin as the specified account.

Creates a connection wrapper to DirectAdmin as the specified account.

Parameters

$url
The base URL of the DirectAdmin server
$username
The username of the account
$password
The password of the account
public string
# getUsername( )

Returns the username behind the current connection.

Returns the username behind the current connection.

Returns

string
Currently logged in user's username
public array
# invokeApi( string $method, string $command, array $options = [] )

Invokes the DirectAdmin API with specific options.

Invokes the DirectAdmin API with specific options.

Parameters

$method
HTTP method to use (ie. GET or POST)
$command
DirectAdmin API command to invoke
$options
Guzzle options to use for the call

Returns

array
The unvalidated response

Throws

Omines\DirectAdmin\DirectAdminException
If anything went wrong on the network level
public Omines\DirectAdmin\DirectAdmin
# loginAs( string $username )

Returns a clone of the connection logged in as a managed user or reseller.

Returns a clone of the connection logged in as a managed user or reseller.

Parameters

$username

Returns

Omines\DirectAdmin\DirectAdmin

Constants summary

string ACCOUNT_TYPE_ADMIN
# 'admin'
string ACCOUNT_TYPE_RESELLER
# 'reseller'
string ACCOUNT_TYPE_USER
# 'user'
API documentation generated by ApiGen