Returns the database name of the counterpart server,
i.e. source if this is target, and vice versa.
@return String The other database name
170116
protected function _fetchOtherDatabaseParams() {
        $otherEnvironment   = $this->getOtherEnvironment();
        $appConfigParams    = $this->_fetchAppConfigParams($otherEnvironment);
        $params             = $appConfigParams->resources->db->params;

        return $params;
    }
71329
protected static function generateDSN()
        {
            $dsn = self::getDriver() . ":host=" . self::getHostname();
            if (self::getPort()) {
                $dsn .= ';port=' . self::getPort();
            }
            $dsn .= ';dbname=' . self::getDatabaseName();
            self::$dsn = $dsn;
        }
844591
public function getSource()
    {
        $source = parent::getSource();

        if (true === $this->getDI()->get('config')->get('db.use_plural')) {
            $source = str_plural($source);
        }

        if ($prefix = $this->getDI()->get('config')->get('db.prefix')) {
            return $prefix . $source;
        }

        return $source;
    }
254725
public function getServerNames() {
        $serverNames = array();
        foreach($this->servers as $login => $data) {
            $serverNames[$login] = $data['name'];
        }
        return $serverNames;
    }
871026
public static function currentServerName()
    {
        if (! empty(env('SERVER_NAME'))) {
            $BASE_URL = env('SERVER_NAME');
        } elseif (! empty($_SERVER['SERVER_NAME'])) {
            $BASE_URL = $_SERVER['SERVER_NAME'];
        } elseif (! empty($_SERVER['HTTP_HOST'])) {
            $BASE_URL = $_SERVER['HTTP_HOST'];
        } else {
            $BASE_URL = 'empty';
        }
        return $BASE_URL;
    }
483518
public function getDatabases(): array
    {
        $names = array_unique(array_merge(array_keys($this->databases), array_keys($this->config->getDatabases())));

        $result = [];
        foreach ($names as $name) {
            $result[] = $this->database($name);
        }

        return $result;
    }
375293
private function DBConnectComand()
    {
        /*
        * Check Database Connection
        */
        switch ($this->DB_TYPE){
        case 'sqlite':
            $dsn = 'sqlite:'.$this->DB_DATABASE;
            $this->validateSqliteFile($this->DB_DATABASE);
            break;

        case 'pgsql':
            $dsn ='pgsql:host='.$this->DB_HOST.';dbname='.$this->DB_DATABASE.';port='.$this->DB_PORT;
            break;

        case 'sqlsrv':
            $availableDrivers = \PDO::getAvailableDrivers();
            if (in_array('dblib', $availableDrivers)) {
                $dsn = 'dblib:host='.$this->DB_HOST.$this->DB_PORT.';dbname='.$this->DB_DATABASE;
            }
            else {
                $dsn = 'sqlsrv:Server='.$this->DB_HOST.$this->DB_PORT.';Database='.$this->DB_DATABASE;
            }
            break;

        default:
            $dsn = 'mysql:host='.$this->DB_HOST.';dbname='.$this->DB_DATABASE.';port='.$this->DB_PORT;
            break;
        }

        return $dsn;
    }
1166666
public function getDsn() {
		// Handle sqlite
		if ($this->driver === 'sqlite') {
			return "sqlite:$this->schema";
		}

		$opts = [];
		$opts['host'] = $this->host;

		if ($this->schema) {
			$opts['dbname'] = $this->schema;
		}

		$dsnOpts = array_merge([], $this->dsnOpts, $opts);
		return "$this->driver:" . implode(';', Map::zip('=', $dsnOpts));
	}
569372
public function getDefaultDatabaseName()
    {
        if ($this->_defaultDatabaseName === null) {
            if (preg_match('/^mongodb:\\/\\/.+\\/([^?&]+)/s', $this->dsn, $matches)) {
                $this->_defaultDatabaseName = $matches[1];
            } else {
                throw new InvalidConfigException("Unable to determine default database name from dsn.");
            }
        }

        return $this->_defaultDatabaseName;
    }
1365001
public function getName()
    {
        if ($this->database instanceof AbstractDatabase
            && $this->database->getName() !== $this->db->getCurrentDatabase()) {
            return $this->database->getName() . '.' . $this->name;
        }

        return $this->name;
    }
584039
protected function serverHostname()
    {
        $result = 'localhost.localdomain';
        if (!empty($this->Hostname)) {
            $result = $this->Hostname;
        } elseif (isset($_SERVER) and array_key_exists('SERVER_NAME', $_SERVER) and !empty($_SERVER['SERVER_NAME'])) {
            $result = $_SERVER['SERVER_NAME'];
        } elseif (function_exists('gethostname') && gethostname() !== false) {
            $result = gethostname();
        } elseif (php_uname('n') !== false) {
            $result = php_uname('n');
        }
        return $result;
    }
964773
public function getConnectionTableName()
    {
        $type_names = [$this->getSourceTypeName(), $this->getTargetTypeName()];
        sort($type_names);

        return implode('_', $type_names);
    }
364601
public function getSourceQName()
	{
		// Use the cached name if there is one.
		if ( ! $this->qname )
		{
			if ( ! property_exists( $this, 'source' ) ) return null;
			$this->qname = $qname = new QName( $this->source['originalPrefix'], $this->source['namespace'], $this->source['name'] );
		}

		return $this->qname;
	}
643178
public function getServerName()
    {
        //====================================================================//
        // Check if Server Name is Overiden by Application Module
        if (isset(Splash::configuration()->ServerHost)) {
            return Splash::configuration()->ServerHost;
        }
        //====================================================================//
        // Check if Available with Secured Reading
        if (!empty(Splash::input('SERVER_NAME'))) {
            return Splash::input('SERVER_NAME');
        }
        //====================================================================//
        // Fallback to Unsecured Mode (Required for Phpunit)
        if (isset($_SERVER['SERVER_NAME'])) {
            return $_SERVER['SERVER_NAME'];
        }

        return '';
    }
921903
public static String getDatabaseName() {
        String databaseName = getMetaDataString(METADATA_DATABASE);

        if (databaseName == null) {
            databaseName = DATABASE_DEFAULT_NAME;
        }

        return databaseName;
    }
1050922
public function getDbName ()
		{
			if ($this->db->getDriverName() == 'mysql')
			{
				preg_match("/dbname=([^;]*)/", $this->db->dsn, $match);
				if (isset($match[ 1 ]))
					return $match[ 1 ];
			}

			return null;
		}
113313
public function getDatabaseName()
    {
        if (isset($this->_data['filter_column']) && is_string($this->_data['filter_column'])) {
            return $this->_data['filter_column'];
        }
        return $this->index();
    }