public function testCustomHttpClientArrayConfigurationCanBeUsed() { $config = array('adapter' => 'Zend\\Http\\Client\\Adapter\\Test', 'useragent' => 'Dyn Custom array configured Http Client'); $tm = new TrafficManagement('testcustomer', 'testusername', 'testpassword', $config); $customHttpClient = new HttpClient(null, $config); $this->assertEquals($customHttpClient, $tm->getApiClient()->getHttpClient()); }
<?php /** * This example creates a single 'A' record and then publishes the changes */ require '../../vendor/autoload.php'; use Dyn\TrafficManagement; use Dyn\TrafficManagement\Record\A; $tm = new TrafficManagement('customerName', 'username', 'password'); // login $tm->createSession(); // retrieve zone $zone = $tm->getZone('example.com'); // configure the new record $record = new A(); $record->setAddress('127.0.0.1'); // create the new record $zone->createRecord($record, 'test.example.com'); // publish changes to the zone (makes the new record live) $zone->publish(); // logout $tm->deleteSession();
<?php /** * This example creates a new zone, adds some records to it, and then publishes. */ require '../../vendor/autoload.php'; use Dyn\TrafficManagement; use Dyn\TrafficManagement\Record\A; use Dyn\TrafficManagement\Record\MX; $tm = new TrafficManagement('customerName', 'username', 'password'); // login $tm->createSession(); // create new zone $zone = $tm->createZone('example.com', '*****@*****.**', 3600); // add an A record to it $record = new A(); $record->setFqdn('www.example.com')->setAddress('127.0.0.1'); $zone->createRecord($record); // add an MX record to it $record = new MX(); $record->setFqdn('example.com')->setPreference(10)->setExchange('mail.example.com'); $zone->createRecord($record); // publish (makes the zone live) $zone->publish(); // logout $tm->deleteSession();