protected static function parseConnectionString(string $connectionString, array $keymap = self::KEY_MAP): array
    {
        $values = [];

        $params = \explode(";", $connectionString);

        if (\count($params) === 1) { // Attempt to explode on a space if no ';' are found.
            $params = \explode(" ", $connectionString);
        }

        foreach ($params as $param) {
            list($key, $value) = \array_map("trim", \explode("=", $param, 2) + [1 => null]);

            if (isset($keymap[$key])) {
                $key = $keymap[$key];
            }

            $values[$key] = $value;
        }

        return $values;
    }
protected static function parseConnectionString(string $connectionString, array $keymap = self::KEY_MAP): array
    {
        $values = [];

        $params = \explode(";", $connectionString);

        if (\count($params) === 1) { // Attempt to explode on a space if no ';' are found.
            $params = \explode(" ", $connectionString);
        }

        foreach ($params as $param) {
            list($key, $value) = \array_map("trim", \explode("=", $param, 2) + [1 => null]);

            if (isset($keymap[$key])) {
                $key = $keymap[$key];
            }

            $values[$key] = $value;
        }

        return $values;
    }
protected static function parseConnectionString ( string $ connectionString , array $ keymap = self :: KEY_MAP ) : array { $ values = [ ] ; $ params = \ explode ( ";" , $ connectionString ) ; if ( \ count ( $ params ) === 1 ) { // Attempt to explode on a space if no ';' are found. $ params = \ explode ( " " , $ connectionString ) ; } foreach ( $ params as $ param ) { list ( $ key , $ value ) = \ array_map ( "trim" , \ explode ( "=" , $ param , 2 ) + [ 1 => null ] ) ; if ( isset ( $ keymap [ $ key ] ) ) { $ key = $ keymap [ $ key ] ; } $ values [ $ key ] = $ value ; } return $ values ; }
Parses a connection string into an array of keys and values given.

@param string $connectionString
@param string[] $keymap Map of alternative key names to canonical key names.

@return array
Parses a connection string into an array of keys and values given .