Beispiel #1
0
 /**
  * Transform resource record to FQDN.
  *
  * @param Dns                    $dns
  * @param AbstractResourceRecord $rr
  *
  * @return string
  */
 public static function getFqdn(Dns $dns, AbstractResourceRecord $rr)
 {
     if (substr($rr->getName(), -1, 1) === '.') {
         $fqdn = substr($rr->getName(), 0, strlen($rr->getName()) - 1);
     } elseif ($rr->getName() == '@') {
         $fqdn = $dns->getOrigin();
     } else {
         $fqdn = $rr->getName() . '.' . $dns->getOrigin();
     }
     return $fqdn;
 }
Beispiel #2
0
 /**
  * Check for zone definition in config file
  *
  * @param \Jeboehm\Lampcp\CoreBundle\Entity\Dns $zone
  *
  * @return bool
  */
 protected function _checkZoneDefinition(Dns $zone)
 {
     $dbPath = sprintf('%s/%s.%s', $this->_getZoneDirectory(), $zone->getOrigin(), 'db');
     $config = file_get_contents($this->_getZoneDefinitionPath());
     $definition = ZoneDefinition::create($zone->getOrigin(), $dbPath);
     if (strpos($config, $definition) !== false) {
         return true;
     }
     return false;
 }