-
Notifications
You must be signed in to change notification settings - Fork 3
DonDominioAPI
Miky edited this page Sep 10, 2015
·
1 revision
The Base API Client for the DonDominio API is the DonDominio class. It's an standalone class that can query the API directly, but also works with module wrappers to provide DonDominioResponse objects generated from API calls.
DonDominioAPI {
__construct ( [ array $options = array() ] )
void setOption ( string $key , string $value )
mixed getOption ( string $key )
string call ( string $url [, array $args = array() ] )
}The DonDominioAPI object accepts the following options inside an associative array:
| Option | Type | Required? | Default | Description |
|---|---|---|---|---|
| endpoint | string | No | URL where the DonDominio API is located | |
| port | integer | No | 443 | Port to use when connecting to the API |
| apiuser | string | Yes | User for the API | |
| apipasswd | string | Yes | Password for the API User | |
| autoValidate | boolean | No | true | Validate type and values for input parameters |
| versionCheck | boolean | No | true | Check whether the API Client is outdated |
| timeout | integer | No | 15 | Timeout in seconds for the connection |
| verifySSL | boolean | No | false | Check the SSL certificate from the API |
| debug | boolean | No | false | Log debug information |
| debugOutput | string | No | NULL | Target of the log information You can provide a filename to store the log, or set this to NULL to log to stdout. Setting it to error_log will use PHP's built-in error logging system. |
| response | array | No | Array of options to pass to the DonDominioResponse object when using wrappers |
Additionally, the response option accepts the following options:
| Option | Type | Required? | Default | Description |
|---|---|---|---|---|
| throwExceptions | boolean | No | true | Enables or disables exceptions thrown from the API wrappers |
## Available methods
Initializes the class. Gets an associative array of options as an argument.
__construct ( [ array $options = array() ] )| Option | Type | Required? | Default | Description |
|---|---|---|---|---|
| options | array | No | Default option set | Options passed to the client |
None
Set an existing or new option in the client options.
void setOption ( string $key , string $value )| Option | Type | Required? | Default | Description |
|---|---|---|---|---|
| key | string | Yes | Name of the option | |
| value | string | Yes | New value for the option |
None
Returns the current value of an option.
mixed getOption ( string $key )| Option | Type | Required? | Default | Description |
|---|---|---|---|---|
| key | string | Yes | Name of the option |
Current value of this option.
Execute a command on the API.
string call ( string $url [, array $args = array() ] )| Option | Type | Required? | Default | Description |
|---|---|---|---|---|
| url | string | Yes | URL of the API command to execute | |
| args | array | No | empty array | Arguments of the API command |
The result returned by the API (usually, a JSON string).