PHP API for mydnshost.co.uk
Find a file
dependabot-preview[bot] 392e17d6f9 [Security] Bump rmccue/requests from 1.7.0 to 1.8.0
Bumps [rmccue/requests](https://github.com/rmccue/Requests) from 1.7.0 to 1.8.0. **This update includes a security fix.**
- [Release notes](https://github.com/rmccue/Requests/releases)
- [Changelog](https://github.com/WordPress/Requests/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rmccue/Requests/compare/v1.7.0...v1.8.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-28 11:25:04 +01:00
src Fix BlockRegex CRUD. mydnshost/mydnshost-api#127 2021-04-03 07:21:38 +01:00
.gitignore More composer stuff. 2017-05-19 21:59:31 +01:00
composer.json Add missing methods. 2017-06-05 04:06:50 +01:00
composer.lock [Security] Bump rmccue/requests from 1.7.0 to 1.8.0 2021-04-28 11:25:04 +01:00
LICENSE Update LICENSE 2017-05-17 12:43:51 +01:00
README.md Update readme to reflect composer package. 2017-05-19 22:32:32 +01:00

mydnshost-php-api

PHP API for mydnshost.co.uk

At the moment this is a very simple library, will composerise this in future and add some kind of cli client wrapper around it.

This implements version 1.0 of the API as documented at https://api.mydnshost.co.uk/1.0/docs/

Installation is via composer require mydnshost/mydnshost-php-api

Example usage, listing domains:

  require_once(__DIR__ . '/vendor/autoload.php');
  $api = new MyDNSHostAPI($config['api']);
  $api->setAuthUserKey('admin@example.org', 'AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE');

  $domains = $api->getDomains();
  var_dump($domains);

Example usage, importing zone files:

  require_once(__DIR__ . '/vendor/autoload.php');
  $api = new MyDNSHostAPI($config['api']);
  $api->setAuthUserKey('admin@example.org', 'AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE');

  $domain = 'test.com';
  $zonedata = file_get_contents('test.com.db');

  echo 'Importing Domain: ', $domain, "\n";

  $result = $api->importZone($domain, $zonedata);
  if (isset($result['error'])) {
    echo 'Unable to import: ', $result['error'];
    if (isset($result['errorData'])) {
      echo ' :: ', $result['errorData'];
    }
    echo "\n"
    continue;
  } else {
    echo 'Success!', "\n";
  }