Finds the Base DN of your domain controller.

@return string|bool
487558
public function findBaseDn()
    {
        $namingContext = $this->getRootDse(['defaultnamingcontext']);

        if (is_array($namingContext) && array_key_exists('defaultnamingcontext', $namingContext)) {
            return $namingContext['defaultnamingcontext'];
        }

        return false;
    }
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;
        }
    }
233041
public function getBaseUrl()
    {
        return $this->getScheme() . $this->getBasicAuth() . $this->getHost() . ":" . $this->getPort() . $this->getEndpoint();
    }
206716
public function getDsn()
    {
        if ($this->checkParam()) {
            $sDsn = 'sqlite:';
            if ($this->getMemory() === true) {
                $sDsn .= ':memory:';
            } else {
                $sDsn .= $this->getDatabase();
            }
            return $sDsn;
        } else {
            return false;
        }
    }
78384
public static function getDomain($rootPid)
    {
        // Use cached one if exists
        if (isset(self::$domainCache[$rootPid])) {
            return self::$domainCache[$rootPid];
        }

        // Fetch domain name
        $query = 'SELECT domainName
                    FROM sys_domain
                   WHERE pid = ' . (int)$rootPid . '
                     AND hidden = 0
                ORDER BY forced DESC,
                         sorting
                   LIMIT 1';
        $ret   = DatabaseUtility::getOne($query);

        // Remove possible slash at the end
        $ret = rtrim($ret, '/');

        // Cache entry
        self::$domainCache[$rootPid] = $ret;

        return $ret;
    }
550675
public function getBasePath()
    {
        if (null == $this->basePath) {
            $this->basePath = strtolower($this->controllerName);
        }
        return $this->basePath;
    }
266852
public function findBaseDn()
    {
        $result = $this->setDn(null)
            ->read()
            ->raw()
            ->whereHas($this->schema->objectClass())
            ->first();

        $key = $this->schema->defaultNamingContext();

        if (is_array($result) && array_key_exists($key, $result)) {
            if (array_key_exists(0, $result[$key])) {
                return $result[$key][0];
            }
        }

        return false;
    }
1325726
protected function _getAppBase()
    {
        $baseUrl = Configure::read('App.base');
        if (!$baseUrl) {
            $request = Router::getRequest(true);
            if (!$request) {
                $baseUrl = '';
            } else {
                $baseUrl = $request->base;
            }
        }
        return $baseUrl . '/';
    }
1339730
public function getDomainName(): string
    {
        return $this->myDomainParts[count($this->myDomainParts) - 1] . ($this->myTld !== null ? '.' . $this->myTld : '');
    }
977637
public function getDomain() {
		$fullBaseUrl = Router::fullBaseUrl();
		if (!empty($fullBaseUrl)) {
			$domain = parse_url($fullBaseUrl, PHP_URL_HOST);
		} else {
			$domain = 'localhost';
		}

		return $domain;
	}
1216798
function GetDSN()
    {
	    return array(
		    'phptype'  => $this->Type,
		    'username' => $this->Username,
		    'password' => $this->Password,
		    'hostspec' => $this->ConnectionString,
		    'database' => $this->DBName,
	    );
	}
1276267
public function checkDomain()
    {
        // parent
        if ($this->group && ! $this->group->checkDomain())
            return false;

        if ($this->domain === null)
            return true;

        $domain = empty($_SERVER['SERVER_NAME']) ? null : $_SERVER['SERVER_NAME'];
        if ($domain === null)
            return false;

        return $domain === $this->domain;
    }
75416
public function getBaseUrl()
    {
        $url = '';
        if (isset($this->scheme)) {
            if ('' !== $this->scheme) {
                $url .= $this->scheme . ':';
            }
            $url .= '//';
        }

        if (isset($this->user)) {
            $url .= $this->user;

            if (isset($this->pass)) {
                $url .= ':' . $this->pass;
            }

            $url .= '@';
        }

        $url .= $this->host;

        if (isset($this->port)) {
            $url .= ':' . $this->port;
        }

        if (isset($this->path)) {
            if ($url != '' && $this->path[0] !== '/') {
                $url .= '/';
            }

            $url .= $this->path;
        }

        return $url;
    }
1013327
public function getBaseDir()
    {
        if (($sValue = $this->getViewConfigParam('basedir')) === null) {
            if ($this->getConfig()->isSsl()) {
                $sValue = $this->getConfig()->getSSLShopURL();
            } else {
                $sValue = $this->getConfig()->getShopURL();
            }

            $this->setViewConfigParam('basedir', $sValue);
        }

        return $sValue;
    }
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;
	}
800217
protected function _getBaseUrl() {
		do {
			$baseUrl = $this->in(__d('cake_installer', 'Input base URL (e.g. %s):', 'http://someapp.fabrikam.com'));
			$baseUrl = trim($baseUrl);
		} while (!preg_match('/http[s]?\:\/\/[A-z0-9\.\/]+/', $baseUrl));

		return trim($baseUrl, '/');
	}
237217
protected function getBaseUrl()
    {
        if (isset($this->baseUrl)) {
            return $this->baseUrl;
        }

        $this->baseUrl = $this->container->getParameter('tenside.self_update.base_url');

        if (false === strpos($this->baseUrl, '://')) {
            $this->baseUrl = (extension_loaded('openssl') ? 'https' : 'http') . '://' . $this->baseUrl;
        }

        return $this->baseUrl;
    }