Collects information about the database eZ Platform is using.
- type
- name
- host
- username.

@return Value\DatabaseSystemInfo
425281
public function collect()
    {
        return new Value\DatabaseSystemInfo([
            'type' => $this->connection->getDatabasePlatform()->getName(),
            'name' => $this->connection->getDatabase(),
            'host' => $this->connection->getHost(),
            'username' => $this->connection->getUsername(),
        ]);
    }
934606
public function get_hostname() {
		$retval = null;
		if(isset($this->connectParams['host'])) {
			$retval = $this->connectParams['host'];
		}
		else {
			throw new \Exception(__METHOD__ .": HOST parameter missing");
		}
		return($this->connectParams['host']);
	}
1216798
function GetDSN()
    {
	    return array(
		    'phptype'  => $this->Type,
		    'username' => $this->Username,
		    'password' => $this->Password,
		    'hostspec' => $this->ConnectionString,
		    'database' => $this->DBName,
	    );
	}
487226
private function getDbName() {
        if (!isset($this->dbname)) {
            $this->dbname = $this->getPDO()->query('select database()')->fetchColumn();
        }
        return $this->dbname;
    }
226041
public function getUserInfo()
    {
        return $this->user ? ($this->pass ? $this->user.':'.$this->pass : $this->user) : '';
    }
942721
protected function _getMySqlServerInfo()
    {
        $aResult = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC)->getRow("SHOW VARIABLES LIKE 'version'");

        return $aResult['Value'];
    }
242235
public function getDbConnectionCmd()
    {
        $dbParams = $this->getDbConnectionParams();
        
        $dbConnectionCmd = 'mysql -u ' . $dbParams['user']
                         . ' -h ' . $dbParams['host']
                         . ' -P ' . $dbParams['port'];
        
        if (strlen($dbParams['password']) > 0) {
            $dbConnectionCmd .= ' -p"' . $dbParams['password'] . '"';
        }
        
        return $dbConnectionCmd;
    }
196024
protected function dbName()
    {

        $dbName = "default";
        $config = $this::$config;
        $configs = ConnectionManager::config($config);
        if ($configs) {
            $dbName = $configs['connection']['database'];
        }

        return $dbName;
    }
571046
def get_database_name(self):
        
        uri_dict = uri_parser.parse_uri(self.host)
        database = uri_dict.get('database', None)
        if not database:
            raise "database name is missing"
        return database
635776
public function getDatabaseInfo()
    {
        $parts = explode(':', $this->database_host);

        $info = array(
            'host' => $parts[0],
            'port' => isset($parts[1]) ? $parts[1] : '3306',
            'user' => $this->database_user,
            'password' => $this->database_password,
            'name' => $this->database_name,
            'prefix' => $this->database_prefix
        );

        return $info;
    }
809118
public static function getUserOperatingSystemName()
    {
        $info = self::getUserWebBrowserInfo();

        $knownSystems = [
            'Linux' => 'Linux',
            'Win'   => 'Windows',
            'Mac'   => 'Mac OS',
        ];

        foreach ($knownSystems as $pattern => $systemName) {
            $matches = [];
            $matchCount = preg_match(sprintf('|%s|', $pattern), $info, $matches);

            if ($matchCount > 0) {
                return $systemName;
            }
        }

        return '';
    }
1003368
private function configureDatabase ()
    {
        $this->comment ("Database configuration:");

        $db['host']     = $this->choice ("Database hostname: ", ['localhost', 'custom'], 0);
        $db['name']     = $this->ask ("Database name: ");
        $db['username'] = $this->ask ("Database username: ");
        $db['password'] = $this->secret ("Database password: ");

        if (!$this->_connected ($db)) {
            $this->info ('');
            $this->error ('Not connected to database');
            $this->info ('');

            return $this->configureDatabase ();
        }

        $this->envData['DB_HOST']     = $db['host'];
        $this->envData['DB_DATABASE'] = $db['name'];
        $this->envData['DB_USERNAME'] = $db['username'];
        $this->envData['DB_PASSWORD'] = $db['password'] . "\n";

        $this->info ('');
        $this->comment ('Database configured successfully!');
        $this->info ('');
    }
682543
public function getServerInfo()
    {
        return sprintf('%s:%s%s%s', $this->host, $this->port, $this->path, $this->core);
    }
930942
public function getHost()
    {
        if ($this->HOST) {

            if (strpos($this->HOST, ':') !== false) {
                $hostParts = explode(':', $this->HOST);

                return $hostParts[0];
            }

            return $this->HOST;
        }

        return $this->SERVER_NAME;
    }
1139806
protected function getDatabaseInformation()
    {
        $this->dbInfo['connection'] = env('DB_CONNECTION');
        $this->dbInfo['host'] = env('DB_HOST');
        $this->dbInfo['database'] = env('DB_DATABASE');
        $this->dbInfo['username'] = env('DB_USERNAME');
        $this->dbInfo['password'] = env('DB_PASSWORD');
        $this->dbInfo['port'] = env('DB_PORT');

        if (!check_db_connection()) {
            $this->error('Please setup your database information first!');
            die();
        }

        $this->info('Database OK...');
    }
647684
public function collect()
    {
        return new Value\HardwareSystemInfo([
            'cpuType' => $this->ezcSystemInfo->cpuType,
            'cpuSpeed' => $this->ezcSystemInfo->cpuSpeed,
            'cpuCount' => $this->ezcSystemInfo->cpuCount,
            'memorySize' => $this->ezcSystemInfo->memorySize,
        ]);
    }
10306
public static function serverPort()
    {
        if ( empty( $GLOBALS['eZSysServerPort'] ) )
        {
            $hostname = self::hostname();
            if ( preg_match( "/.*:([0-9]+)/", $hostname, $regs ) )
            {
                $port = (int) $regs[1];
            }
            else
            {
                $port = (int) self::serverVariable( 'SERVER_PORT', true );
            }

            if ( !$port )
            {
                $port = 80;
            }

            $GLOBALS['eZSysServerPort'] = $port;
        }
        return $GLOBALS['eZSysServerPort'];
    }