1. Go to this page and download the library: Download kasperhartwich/quickdns 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/ */
kasperhartwich / quickdns example snippets
use QuickDns\QuickDns;
$quickDns = new QuickDns('[email protected]', 'password');
$quickDns->login(); // optional: fails here rather than later
$quickDns->isLoggedIn(); // true
$quickDns = new QuickDns('[email protected]', 'password', new \GuzzleHttp\Client(['handler' => $stack]));
use QuickDns\Zone;
foreach ($quickDns->getZones() as $zone) {
echo $zone->domain, ': ', implode(', ', $zone->templates), PHP_EOL;
}
// Create a zone. create() returns it with its id, so it can be used right away.
$zone = (new Zone($quickDns, 'example.dk'))->create();
$zone->delete();
// Or look a zone up by domain.
$quickDns->getZone('example.dk')->delete();
use QuickDns\QuickDns;
use QuickDns\Zone;
$quickDns = new QuickDns('[email protected]', 'password');
$template = $quickDns->getTemplate('my-template');
foreach (['domain1.dk', 'domain2.dk', 'domain3.dk'] as $domain) {
$zone = (new Zone($quickDns, $domain))->create();
$template->addZone($zone);
echo "{$domain} created and added to {$template->name}", PHP_EOL;
}
use QuickDns\Exceptions\CommandFailed;
try {
(new Zone($quickDns, 'example.dk'))->create();
} catch (CommandFailed $e) {
echo $e->function(), ' failed: ', $e->statusText(), PHP_EOL;
}
use QuickDns\Laravel\Facades\QuickDns;
$zones = QuickDns::getZones();
use QuickDns\Testing\FakeQuickDns;
use QuickDns\Zone;
$fake = new FakeQuickDns();
$fake->addTemplate('standard');
$fake->addZone('existing.dk', templates: ['standard']);
$fake->addRecord('existing.dk', '@', 'MX', 'mx1.example.dk.', 3600, 10);
$quickDns = $fake->quickDns(); // or new QuickDns('[email protected]', 'secret', $fake->client())
(new Zone($quickDns, 'new.dk'))->create();
$fake->hasZone('new.dk'); // true
$fake->templatesOf('existing.dk'); // ['standard']
$fake->recordsOf('existing.dk'); // the zone's records after your writes
$fake->requests(); // every request it answered
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.