Get value of the first 'dNSName' type.

@return string
327415
public function firstDNS(): string
    {
        $gn = $this->firstOf(GeneralName::TAG_DNS_NAME);
        if (!$gn instanceof DNSName) {
            throw new \RuntimeException(
                DNSName::class . " expected, got " . get_class($gn));
        }
        return $gn->name();
    }
860116
public String firstCalledName() {
        if( addr instanceof NbtAddress ) {
            return ((NbtAddress)addr).firstCalledName();
        } else {
            calledName = ((InetAddress)addr).getHostName();
            if( isDotQuadIP( calledName )) {
                calledName = NbtAddress.SMBSERVER_NAME;
            } else {
                int i = calledName.indexOf( '.' );
                if( i > 1 && i < 15 ) {
                    calledName = calledName.substring( 0, i ).toUpperCase();
                } else if( calledName.length() > 15 ) {
                    calledName = NbtAddress.SMBSERVER_NAME;
                } else {
                    calledName = calledName.toUpperCase();
                }
            }
        }

        return calledName;
    }
147837
protected function getTypesSorted()
    {
        $types = $this->getTypes();
        usort($types, function ($first, $second) {
            /* @var Type $first */
            /* @var Type $second */
            return $first->name == 'mixed' ? 1 : 0;
        });

        return $types;
    }
1359661
public function getDsn()
    {
        if ($this->checkParam()) {
            if (!empty($this->getHost())) {
                $sDsn = 'mysql:host=' . $this->getHost() . ';';
                if (!empty($this->getPort())) {
                    $sDsn .= 'port=' . $this->getPort() . ';';
                }
            } else {
                $sDsn = 'mysql:unixsocket=' . $this->getUnixSocket() . ';';
            }
            if (!empty($this->getDatabase())) {
                $sDsn .= 'dbname=' . $this->getDatabase() . ';';
            }
            if (!empty($this->getCharset())) {
                $sDsn .= 'charset=' . $this->getCharset() . ';';
            }
            return $sDsn;
        } else {
            return false;
        }
    }
1073722
public function getName(){
		$result = null;
		if (isset($this->userInfo['first_name']) && isset($this->userInfo['last_name'])) {
			$result = $this->userInfo['first_name'] . ' ' . $this->userInfo['last_name'];
			}
		elseif (isset($this->userInfo['first_name']) && !isset($this->userInfo['last_name'])) {
			$result = $this->userInfo['first_name'];
			}
		elseif (!isset($this->userInfo['first_name']) && isset($this->userInfo['last_name'])) {
			$result = $this->userInfo['last_name'];
			}
		return $result;
		}
734620
public static function getName($type)
    {
        switch ($type) {
            case static::T_UNSPECIFIED:
                return 'Unspecified/unknown address';
            case static::T_RESERVED:
                 return 'Reserved/internal use only';
            case static::T_THISNETWORK:
                 return 'Refer to source hosts on "this" network';
            case static::T_LOOPBACK:
                 return 'Internet host loopback address';
            case static::T_ANYCASTRELAY:
                 return 'Relay anycast address';
            case static::T_LIMITEDBROADCAST:
                 return '"Limited broadcast" destination address';
            case static::T_MULTICAST:
                 return 'Multicast address assignments - Indentify a group of interfaces';
            case static::T_LINKLOCAL:
                 return '"Link local" address, allocated for communication between hosts on a single link';
            case static::T_LINKLOCAL_UNICAST:
                return 'Link local unicast / Linked-scoped unicast';
            case static::T_DISCARDONLY:
                 return 'Discard only';
            case static::T_DISCARD:
                 return 'Discard';
            case static::T_PRIVATENETWORK:
                 return 'For use in private networks';
            case static::T_PUBLIC:
                 return 'Public address';
            default:
                return $type === null ? 'Unknown type' : sprintf('Unknown type (%s)', $type);
        }
    }
66430
public function firstDN(): Name
    {
        $gn = $this->firstOf(GeneralName::TAG_DIRECTORY_NAME);
        if (!$gn instanceof DirectoryName) {
            throw new \RuntimeException(
                DirectoryName::class . " expected, got " . get_class($gn));
        }
        return $gn->dn();
    }
956458
public function getDSN () {
        $dsn = [];

        // Pick $data_source parameters that make up the DSN string.
        $map = [
            'host' => 'host',
            'port' => 'port',
            'dbname' => 'database',
            'unix_socket' => 'unix_socket',
            'charset' => 'charset'
        ];

        foreach ($map as $dsn_name => $data_source_parameter_name) {
            if (isset($this->data_source[$data_source_parameter_name])) {
                $dsn[] = $dsn_name . '=' . $this->data_source[$data_source_parameter_name];
            }
        }

        if ($dsn) {
            $dsn = $this->data_source['driver'] . ':' . implode(';', $dsn);
        } else {
            $dsn = $this->data_source['driver'];
        }

        return $dsn;
    }
100998
private function getRemoteHostname()
    {
        $hostname = NULL;

        if(!is_null($this->ip)) {
            $hostname = gethostbyaddr($this->ip);
        }
        return $hostname;
    }
345703
public function getRemoteHostname() {
        static $hostname = null;
        if (!$hostname) {
            /** @var string $hostname */
            $hostname = NetTools::getHostByAddress($this->getRemoteAddress());
        }
        return $hostname;
    }
1365233
public function
	GetDSN() {
	/*//
	@type string
	get the connection dsn string for this database connection.
	//*/

		switch(strtolower($this->Type)) {
			case 'mysql': return sprintf(
				'%s:host=%s;dbname=%s;charset=%s',
				$this->Type,
				$this->Hostname,
				$this->Database,
				$this->Charset
			);
			case 'sqlite': return sprintf(
				'%s:%s',
				$this->Type,
				$this->Database
			);
			default: return sprintf(
				'%s:host=%s;dbname=%s, %s, %s;charset=%s',
				$this->Type,
				$this->Hostname,
				$this->Database,
				$this->Username,
				$this->Password,
				$this->Charset
			);
		}
	}
767431
public function getDomain($first_level = false)
    {
        $host = $this->getHost();

        if (empty($host)) {
            return '';
        }

        $host = array_reverse(explode('.', $host));

        switch (count($host)) {
            case 1:
                return $host[0];

            case 2:
                return $first_level ? ($host[1].'.'.$host[0]) : $host[1];

            default:
                $tld = $host[1].'.'.$host[0];
                $suffixes = self::getSuffixes();

                if (in_array($tld, $suffixes, true)) {
                    return $first_level ? $host[2].'.'.$tld : $host[2];
                }

                return $first_level ? $host[1].'.'.$host[0] : $host[1];
        }
    }
638292
public function getNameId()
    {
        $nameIdvalue = null;
        $nameIdData = $this->getNameIdData();
        if (!empty($nameIdData) && isset($nameIdData['Value'])) {
            $nameIdvalue = $nameIdData['Value'];
        }
        return $nameIdvalue;
    }
994830
public function getDsn()
    {
        if (!$this->config) {
            return '';
        }
        $dsn = array();

        if ($this->config->getHost()) {
            $dsn[] = 'host='.$this->config->getHost();
        }

        if ($this->config->getPort()) {
            $dsn[] = 'port='.$this->config->getPort();
        }

        if ($this->config->getName()) {
            $dsn[] = 'dbname='.$this->config->getName();
        }

        if ($this->config->getUser()) {
            $dsn[] = 'user='.$this->config->getUser();
        }

        if ($this->config->getPass()) {
            $dsn[] = 'password='.$this->config->getPass();
        }

        return $this->getPrefix().implode(';', $dsn);
    }
232176
public function getDomain()
    {
        $result = $this->host;
        if(null !== $this->port)
        {
            $result .= ':' . $this->port;
        }
        return $result;
    }
1093140
public function dns($dns = null)
    {
        if ($dns) {
            $this->_config['dns'] = $dns;
            return $dns;
        }

        if (isset($this->_config['dns'])) {
            return $this->_config['dns'];
        }

        return 'mongodb://localhost:27017';
    }
406736
public function getHostname()
    {
        if (is_null($this->hostname)) {
            $this->hostname = gethostbyaddr($this->ip);
        }

        return $this->hostname;
    }