protected function parseConnection($connection)
    {
        $pos  = strpos($connection, '=');
        $name = substr($connection, 0, $pos);
        $dsn  = substr($connection, $pos + 1, strlen($connection));

        $pos  = strpos($dsn, ':');
        $adapter = substr($dsn, 0, $pos);

        $extras = [];
        foreach (explode(';', $dsn) as $element) {
            $parts = preg_split('/=/', $element);

            if (2 === count($parts)) {
                $extras[strtolower($parts[0])] = urldecode($parts[1]);
            }
        }
        $extras['adapter'] = $adapter;

        return [$name, $dsn, $extras];
    }
protected function parseConnection($connection)
    {
        $pos  = strpos($connection, '=');
        $name = substr($connection, 0, $pos);
        $dsn  = substr($connection, $pos + 1, strlen($connection));

        $pos  = strpos($dsn, ':');
        $adapter = substr($dsn, 0, $pos);

        $extras = [];
        foreach (explode(';', $dsn) as $element) {
            $parts = preg_split('/=/', $element);

            if (2 === count($parts)) {
                $extras[strtolower($parts[0])] = urldecode($parts[1]);
            }
        }
        $extras['adapter'] = $adapter;

        return [$name, $dsn, $extras];
    }
protected function parseConnection ( $ connection ) { $ pos = strpos ( $ connection , '=' ) ; $ name = substr ( $ connection , 0 , $ pos ) ; $ dsn = substr ( $ connection , $ pos + 1 , strlen ( $ connection ) ) ; $ pos = strpos ( $ dsn , ':' ) ; $ adapter = substr ( $ dsn , 0 , $ pos ) ; $ extras = [ ] ; foreach ( explode ( ';' , $ dsn ) as $ element ) { $ parts = preg_split ( '/=/' , $ element ) ; if ( 2 === count ( $ parts ) ) { $ extras [ strtolower ( $ parts [ 0 ] ) ] = urldecode ( $ parts [ 1 ] ) ; } } $ extras [ 'adapter' ] = $ adapter ; return [ $ name , $ dsn , $ extras ] ; }
Parse a connection string and return an array with name, dsn and extra informations

@parama string $connection The connection string

@return array
Parse a connection string and return an array with name dsn and extra informations