コード例 #1
0
 public function get_answer($question)
 {
     $answer = array();
     $domain = trim($question[0]['qname'], '.');
     $type = RecordTypeEnum::get_name($question[0]['qtype']);
     $records = $this->get_records_recursivly($domain, $type);
     foreach ($records as $record) {
         $answer[] = array('name' => $question[0]['qname'], 'class' => $question[0]['qclass'], 'ttl' => $record['ttl'], 'data' => array('type' => $question[0]['qtype'], 'value' => $record['answer']));
     }
     return $answer;
 }
コード例 #2
0
ファイル: HostsProvider.php プロジェクト: awaysoft/AwayDNS
 public function get_answer($question)
 {
     $answer = array();
     $domain = trim($question[0]['qname'], '.');
     $type = RecordTypeEnum::get_name($question[0]['qtype']);
     if (isset($this->dns_records[$domain]) && isset($this->dns_records[$domain][$type])) {
         if (is_array($this->dns_records[$domain][$type])) {
             foreach ($this->dns_records[$domain][$type] as $ip) {
                 $answer[] = array('name' => $question[0]['qname'], 'class' => $question[0]['qclass'], 'ttl' => $this->DS_TTL, 'data' => array('type' => $question[0]['qtype'], 'value' => $ip));
             }
         }
     }
     return $answer;
 }