本文整理汇总了PHP中Addresses::ptr_unlink_subnet_addresses方法的典型用法代码示例。如果您正苦于以下问题:PHP Addresses::ptr_unlink_subnet_addresses方法的具体用法?PHP Addresses::ptr_unlink_subnet_addresses怎么用?PHP Addresses::ptr_unlink_subnet_addresses使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Addresses
的用法示例。
在下文中一共展示了Addresses::ptr_unlink_subnet_addresses方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$zone = $PowerDNS->get_ptr_zone_name($subnet->ip, $subnet->mask);
// try to fetch domain
$domain = $PowerDNS->fetch_domain_by_name($zone);
// default values
$values = json_decode($User->settings->powerDNS, true);
$values['name'] = $zone;
// domain missing, create it and default records
if ($domain === false) {
// create domain
$PowerDNS->domain_edit("add", array("name" => $zone, "type" => "NATIVE"));
// create default records
$PowerDNS->create_default_records($values);
}
// remove existing records and links
$PowerDNS->remove_all_ptr_records($domain->id);
$Addresses->ptr_unlink_subnet_addresses($subnet->id);
// fetch all hosts
$hosts = $Addresses->fetch_subnet_addresses($subnet->id, "ip_addr", "asc");
// create PTR records
if (sizeof($hosts) > 0) {
foreach ($hosts as $h) {
// ignore PTR
if ($h->PTRignore == "1") {
$ignored[] = $h;
} elseif ($Result->validate_hostname($h->dns_name) !== false) {
// formulate new record
$record = $PowerDNS->formulate_new_record($domain->id, $PowerDNS->get_ip_ptr_name($h->ip), "PTR", $h->dns_name, $values['ttl']);
// insert record
$PowerDNS->add_domain_record($record, false);
// link
$Addresses->ptr_link($h->id, $PowerDNS->lastId);