Check if the supplied record is different from the most recently stored
DNS record available.

@param  string  $domain
@param  array  $record
@return bool
327411
protected function hasDnsRecordChanged($domain, $record)
    {
        if (! $dns_history = History::where('meta', $domain)->orderBy('created_at', 'desc')->first()) {
            $this->saveDnsRecord($domain, $record);
            return false;
        }

        $differences = $this->compareDnsRecords($dns_history->record, $record);

        return (count($differences['original']) && count($differences['new']));
    }
915142
public function thereShouldExistTheDomainARecordWithTheValue(string $name, string $domain, string $value): void
    {
        $record = $this->findRecord($this->adapter->existingRecords, $domain, $name, Record::TYPE_ADDRESS);

        Assert::that($record)->notNull();
        Assert::that($record->getValue())->same($value);
    }
557839
private function findRecord(array $records, string $domain, string $name, string $type): ?Record
    {
        foreach ($records as $record) {
            if (
                $domain === $record->getDomain() &&
                $name === $record->getName() &&
                $type === $record->getType()
            ) {
                return $record;
            }
        }

        return null;
    }
390342
public static function isTemporaryDomain(string $domain): bool
    {
        if (self::$domainsTemporary === null) {
            self::$domainsTemporary = self::getData('domainsTemporary');
        }

        if (\in_array($domain, self::$domainsTemporary, true)) {
            return true;
        }

        if (\preg_match('/.*\.(?:tk|ml|ga|cf|gq)$/si', $domain)) {
            return true;
        }

        return false;
    }
55096
public function processRecord(array $record)
    {
        $request = $this->requestStack->getCurrentRequest();

        $record['extra']['user_ip'] = '0.0.0.0';
        if (null !== $request) {
            $record['extra']['user_ip'] = $request->getClientIp();
            $record['extra']['user_name'] = $this->securityContext->getToken()->getUsername();
        }

        $record['extra']['site_name'] = $this->context->getSiteName();
        $record['extra']['site_id'] = $this->context->getSiteId();

        return $record;
    }
318888
private function getNormalisedRecordName(Record $record): string
    {
        return '@' === $record->getName()
            ? $record->getDomain()
            : $record->getName() . '.' . $record->getDomain();
    }
891766
public function processRecord(array $record)
    {
        if (is_null($this->requestId)) {
            $this->requestId = uniqid('');
        }

        $record['extra']['requestId'] = $this->requestId;

        return $record;
    }
1354725
public function doesRecordNeedUpdate(GedcomRecord $record): bool
    {
        return $record instanceof Individual && $record->facts(['DEAT'])->isEmpty() && $record->isDead();
    }
951455
public function destroyRecord($domain, $recordId)
    {
        return $this->processQuery($this->buildRecordsQuery($domain, $recordId, RecordsActions::ACTION_DESTROY));
    }
780482
def is_subdomain_record(rec):
    
    txt_entry = rec['txt']
    if not isinstance(txt_entry, list):
        return False

    has_parts_entry = False
    has_pk_entry = False
    has_seqn_entry = False
    for entry in txt_entry:
        if entry.startswith(SUBDOMAIN_ZF_PARTS + "="):
            has_parts_entry = True
        if entry.startswith(SUBDOMAIN_PUBKEY + "="):
            has_pk_entry = True
        if entry.startswith(SUBDOMAIN_N + "="):
            has_seqn_entry = True

    return (has_parts_entry and has_pk_entry and has_seqn_entry)
454868
public function useDomain($domain)
    {
        $old = $this->_currentDomain;
        $this->_currentDomain = $domain;
        textdomain($domain);
        return $old;
    }
799617
def records(self, domain, params=None):
        ''' 
        '''
        params = update_params(params, {'domain': domain})
        return self.request('/v1/dns/records', params, 'GET')
63356
public function processRecord(array $record)
    {
        if (is_null($this->user)) {
            /* @var TokenStorageInterface $securityTokenStorage */
            $securityTokenStorage = $this->container->get('security.token_storage');
            if (($securityTokenStorage !== null) && ($securityTokenStorage->getToken() !== null) && ($securityTokenStorage->getToken()->getUser() instanceof \Symfony\Component\Security\Core\User\AdvancedUserInterface)) {
                $this->user = $securityTokenStorage->getToken()->getUser();
                $this->record['extra']['user']['username'] = $this->user->getUsername();
                $this->record['extra']['user']['roles'] = $this->user->getRoles();
                $this->record['extra']['user']['is_account_non_expired'] = $this->user->isAccountNonExpired();
                $this->record['extra']['user']['is_account_non_locked'] = $this->user->isAccountNonLocked();
                $this->record['extra']['user']['is_credentials_non_expired'] = $this->user->isCredentialsNonExpired();
                $this->record['extra']['user']['is_enabled'] = $this->user->isEnabled();
            }
        }

        return array_merge($record, $this->record);
    }
826310
public function doesRecordNeedUpdate(GedcomRecord $record): bool
    {
        $gedcom = $record->gedcom();

        return !$this->error && preg_match('/(?:' . $this->regex . ')/mu' . $this->case, $gedcom);
    }
1098401
def search_records(self, domain, record_type, name=None, data=None):
        
        return domain.search_records(record_type=record_type,
                name=name, data=data)
164844
private function fetchDomainId(string $domainName, string $recordName): ?int
    {
        if (!isset($this->domainRecords[$domainName])) {
            $this->domainRecords[$domainName] = $this->domainRecordApi->getAll($domainName);
        }

        foreach ($this->domainRecords[$domainName] as $domainRecord) {
            if ($recordName === $domainRecord->name && Record::TYPE_ADDRESS === $domainRecord->type) {
                return $domainRecord->id;
            }
        }

        return null;
    }
806720
protected function write(array $record)
    {
        if ($record['level'] < Logger::ERROR) {
            return false;
        }

        if (isset($record['context']['exception'])
            && ($record['context']['exception'] instanceof NotFoundHttpException
                || $record['context']['exception'] instanceof AccessDeniedHttpException
                || $record['context']['exception'] instanceof ResourceNotFoundException)
        ) {
            return false;
        }

        $msg = '';
        if ($this->server->get('HTTP_HOST') && $this->server->get('REQUEST_URI')) {
            $scheme = $this->httpScheme ? $this->httpScheme : $this->server->get('REQUEST_SCHEME');
            if (is_null($scheme)) {
                $https = $this->server->get('HTTPS');
                $scheme = (empty($https) || 'off' === $https) ? 'http' : 'https';
            }
            $host = $this->httpHost ? $this->httpHost : $this->server->get('HTTP_HOST');
            if (false !== idn_to_utf8($host)) {
                $host = idn_to_utf8($host);
            }

            $msg = sprintf('Request url: %s://%s%s<br/>', $scheme, $host, $this->server->get('REQUEST_URI'));
        }

        if ($this->post->count() > 0 || $this->get->count() > 0) {
            $data = array_merge($this->post->all(), $this->get->all());
            $msg .= "Request data: " . json_encode($data) . "<br>";
        }

        if (isset($record['message'])) {
            $msg .= $record['message'];
            $this->hipchat->message_room($this->room, $this->name, $msg, true);

            return true;
        }

        return false;
    }