library/Benri/Bootstrap.php
private function _parseDsn($dsn)
    {
        $dsn = parse_url($dsn);
        $cfg = [];

        //
        // Some drivers (a.k.a. PDO_PGSQL) complains if the port is set
        // without a value, even NULL
        if (isset($dsn['port'])) {
            $cfg['port'] = $dsn['port'];
        }

        return $cfg + [
            'dbname'    => isset($dsn['path']) ? trim($dsn['path'], '/') : null,
            'host'      => isset($dsn['host']) ? $dsn['host']            : null,
            'password'  => isset($dsn['pass']) ? $dsn['pass']            : null,
            'username'  => isset($dsn['user']) ? $dsn['user']            : null,
        ];
    }
private function _parseDsn($dsn)
    {
        $dsn = parse_url($dsn);
        $cfg = [];

        //
        // Some drivers (a.k.a. PDO_PGSQL) complains if the port is set
        // without a value, even NULL
        if (isset($dsn['port'])) {
            $cfg['port'] = $dsn['port'];
        }

        return $cfg + [
            'dbname'    => isset($dsn['path']) ? trim($dsn['path'], '/') : null,
            'host'      => isset($dsn['host']) ? $dsn['host']            : null,
            'password'  => isset($dsn['pass']) ? $dsn['pass']            : null,
            'username'  => isset($dsn['user']) ? $dsn['user']            : null,
        ];
    }
Parse a DSN string and return return its components.

If you want to use DSN, you **must** provide a valid AND complete DSN.

Also, you are responsible to set both adapter and charset options, so
a valid DSN would looks something like this (DSNs MUST begin with `db://`):
db://root:root@127.0.0.1/my_db or
db://root:root@localhost/db_name

@param string $dsn
@return array