a1extran/dns-made-easy

此包已被废弃且不再维护。没有建议的替代包。
此包最新版本(1.1.1)没有可用的许可证信息。

Dns Made Easy API 的 PHP 封装。

1.1.1 2015-03-07 17:16 UTC

This package is not auto-updated.

Last update: 2020-10-02 18:23:22 UTC


README

示例用法

创建 DnsMadeEasy 类的实例

// log into your DNS Made Easy account to generate/obtain your API key and secret key.
// specify TRUE for the last parameter if you want to make test API calls.
$dme = new DnsMadeEasy('yourApiKey', 'yourSecretKey', TRUE);

添加域名

$result = $dme->domains->add('foobar.com');

if ($errors = $result->errors()) {
	print_r($errors);
}
else {
	// outputs the raw results
	print_r($result->rawBody());

	// grab the JSON decoded results.
	// use TRUE to return an associative array, FALSE to return an object.
	$domain = $result->body(FALSE);

	// output the name servers associated with this domain.
	print_r($domain->nameServer);
}

添加 DNS 记录

$record = array(
	'name' => '',
	'type' => 'A',
	'data' => '2.4.8.16',
	'ttl' => 1800,
);

$result = $dme->records->add('foobar.com', $record);

if ($errors = $result->errors()) {
	print_r($errors);
}
else {
	// grab the JSON decoded results.
	// use TRUE to return an associative array, FALSE to return an object.
	$record = $result->body(FALSE);

	// output the assigned record ID
	print_r($record->id);
}