rdx / fxw-api
通过抓取的方式实现FXW DNS API
1.1
2018-04-01 01:16 UTC
Requires
- guzzlehttp/guzzle: ^6.3
- rdx/js-dom: ^1.1
This package is auto-updated.
Last update: 2024-08-29 04:28:36 UTC
README
通过抓取他们的控制面板来管理FXW DNS记录,因为它们没有提供API。
$client = new rdx\fxwdns\Client(new rdx\fxwdns\WebAuth('mail@address.com', 'p@assword'));
// Explicit log in
$bool = $client->logIn();
// $client->customer->{id,name} contains some customer info from dashboard
// Get managed domains
$domains = $client->getDomains();
// Get specific domain
$domain = $client->getDomain('example.com');
// Get domain's DNS records
$records = $client->getDnsRecords($domain);
// Add DNS record
$record = new rdx\fxwdns\DnsRecord(0, 'sub.example.com', 'A', '12.34.56.78', 3600);
$bool = $client->addDnsRecord($domain, $record);
// Find specific DNS record(s)
$records = $client->findDnsRecords(['type' => 'TXT', 'name' => 'sup.example.com']);
// Remove DNS record
$bool = $client->deleteDnsRecord($domain, $records[0]);