Getting the <domain:cd> node by domain name.

@param string $domain fully qualified name of the domain object

@return \DOMElement

@throws UnexpectedValueException
342218
protected function getDomaincd($domain)
    {
        $pattern = '//epp:epp/epp:response/epp:resData/domain:chkData/domain:cd[domain:name[php:functionString("XPath\quote", text()) = \'%s\']]';
        $query = sprintf($pattern, XPath\quote($domain));
        $node = $this->getFirst($query);

        if ($node === null) {
            throw new UnexpectedValueException(sprintf('Domain with name [%s] not found.', $domain));
        }

        return $node;
    }
1304514
public function getAdminForEntity($entity): Admin
    {
        $class = \get_class($entity);

        if (array_key_exists($class, $this->cache)) {
            return $this->cache[$class];
        }

        foreach ($this->adminRegistry->getAdmins() as $admin) {
            if (is_a($entity, $admin->getEntity())) {
                $this->cache[$class] = $admin;

                return $admin;
            }
        }

        throw new \UnexpectedValueException("No admin matching for entity '{$class}'");
    }
592926
public function clean($domain)
    {
        $domain = trim($domain);
        $domain = preg_replace('#^https?://#', '', $domain);
        if (substr(strtolower($domain), 0, 4) == "www.") $domain = substr($domain, 4);

        return $domain;
    }
862400
public static function getNonSequenceDomain(string $domain) : string {
		if (strpos($domain, '_sequence') !== false) {
			return str_replace('_sequence', '', $domain);
		}
		return $domain;
	}
34373
public function getBind($domain = null)
    {
        if (is_null($domain)) {
            $domain = $this->domain;
        } elseif (true === $domain) {
            return $this->bind;
        } elseif (false === strpos($domain, '.')) {
            $domain .= '.' . $this->request->rootDomain();
        }

        $subDomain = $this->getSubDomain();

        if (strpos($subDomain, '.')) {
            $name = '*' . strstr($subDomain, '.');
        }

        if (isset($this->bind[$domain])) {
            $result = $this->bind[$domain];
        } elseif (isset($name) && isset($this->bind[$name])) {
            $result = $this->bind[$name];
        } elseif (isset($this->bind['*'])) {
            $result = $this->bind['*'];
        } else {
            $result = null;
        }

        return $result;
    }
165363
public static function getXDomainId($domain)
	{
		$db = \App::get('db');

		if (empty($domain) || ($domain == 'hubzero'))
		{
			return false;
		}

		$query = 'SELECT domain_id FROM `#__xdomains` WHERE domain=' . $db->quote($domain) . ';';
		$db->setQuery($query);

		$result = $db->loadObject();

		if (empty($result))
		{
			return false;
		}

		return $result->domain_id;
	}
862887
protected function _matchDomain($domain) 
    {
        $ret = array();

        foreach (array_keys($this->cookies) as $cdom) {
            $regex = "/" . preg_quote($cdom, "/") . "$/i";
            if (preg_match($regex, $domain)) { $ret[$cdom] = &$this->cookies[$cdom];
            }
        }

        return $ret;
    }
1034852
public function getDomainInfo( $domain ) {
		$domain = $this->normalizeDomain( $domain );
		// Check cache and custom-registered domains
		if ( !isset( $this->domainInfos[ $domain ] ) ) {
			// Default to local domain
			$dir = $this->localBaseDir . '/language/messages/' . $domain;
			if ( !is_dir( $dir ) ) {
				// Domain does not exist
				return false;
			}
			$this->domainInfos[ $domain ] = [
				'dir' => $dir,
			];
		}
		return $this->domainInfos[ $domain ];
	}
1202120
protected function getDnsRecord($domain)
    {
        if (filter_var($domain, FILTER_VALIDATE_URL) === false) {
            $this->eye->logger()->debug('DNS URL not valid', $domain);
            return false;
        }

        try {
            $dns = $this->pollDns($this->parseUrl($domain));
        } catch (Exception $e) {
            $this->eye->logger()->debug('DNS lookup failed', ['domain' => $domain,
                                                              'exception' => $e->getMessage()]);
            return false;
        }

        return $this->stripTtlFromDns($dns);
    }
783640
public function transform($node)
    {
        if (null === $node) {
            return;
        }

        if (!$node instanceof NodeInterface) {
            throw new UnexpectedTypeException($node, NodeInterface::class);
        }

        return $node->getIdentifier();
    }
783653
public static function getByDomain($domain)
    {
        $slot = new Cache\Slot\ServerByDomain($domain);
        if (false === ($server = $slot->load())) {

            $fields = self::getDbConnection()->fetchAssoc( 'SELECT B.* FROM server_aliases A LEFT JOIN dir_data B USING (ID) WHERE B.hidden<>1 and B.is_server<>0 and A.name = ?', array( $domain ) );
            
            if ($fields) {
                $server = self::fetch($fields); 
            } else {
                $server = self::getDefault();
                if (!$server) return FALSE;
            }
            $slot->addTag(new Cache\Tag\CatalogID($server->id));
            $slot->save($server);
        }
        return $server;
    }
734746
public function retrieve($domain)
	{
		$messages = $this->session->get($this->key($domain), array());

		if (count($messages))
		{
			$this->clear($domain);
		}

		return $messages;
	}
733210
public function retrieve($domain)
	{
		if (!($messages = Monster::eat($this->key($domain))))
		{
			$messages = array();
		}

		if (count($messages))
		{
			$this->clear($domain);
		}

		return $messages;
	}
1047849
public function execute($domain = null)
    {
        $response = $this->client->post(
            $this->url,
            [
                'form_params' => [
                    'login' => $this->login,
                    'passwd' => $this->password,
                    'label' => $domain,
                    'type' => 'standard',
                    'origin_scheme' => 'http',
                    'origin_url' => 'hosted.adback.co',
                    'cname' => $domain,
                ]
            ]
        );

        $data = json_decode($response->getBody()->getContents(), true);

        if ('ok' != $data['status']) {
            throw new QueryErrorException($data['description']);
        }

        return $data['cdnResource']['cdn_url'];
    }
179510
public function isValid($domain)
    {
        $this->setFormat('object');
        $Result = $this->parse($domain, '');

        return $Result->validHostname;
    }
1248495
public function domain($domain = null)
    {
        if (is_null($domain)) {
            return $this->getDomain();
        }

        $this->action['domain'] = $domain;

        return $this;
    }
324411
protected function getValue($string, $domain, $locale)
    {
        if (!$domain) {
            $domain = 'default';
        }

        $this->loadDomain($domain, $locale);

        // We have to treat 'languages', 'default', 'modules' etc. domains differently.
        if (!(isset($GLOBALS['TL_LANG'][$domain]) && is_array($GLOBALS['TL_LANG'][$domain]))
            && (substr($domain, 0, 2) != 'tl_')
        ) {
            $lang = $GLOBALS['TL_LANG'];
        } else {
            if (!is_array($GLOBALS['TL_LANG'][$domain])) {
                return $string;
            }
            $lang = $GLOBALS['TL_LANG'][$domain];
        }

        $chunks = explode('.', $string);

        while (($chunk = array_shift($chunks)) !== null) {
            if (!array_key_exists($chunk, $lang)) {
                return $string;
            }

            $lang = $lang[$chunk];
        }

        return $lang;
    }