public static function parse($url)
    {
        $scheme = substr($url, 0, strpos($url, ':'));
        if (strpos($scheme, '+')) {
            $scheme = substr($scheme, 0, strpos($scheme, '+'));
        }

        if (!$scheme) {
            throw new \Exception(sprintf('The url \'%s\' could not be parsed', $url));
        }

        if (isset(static::$schemeMap[$scheme])) {
            $className = static::$schemeMap[$scheme];
        } else {
            $className  = static::currentNamespace() . '\\' . ucfirst($scheme) . 'Dsn';
            if (!class_exists($className)) {
                $className  = static::currentClass();
            }
        }
        return new $className($url);
    }
public static function parse($url)
    {
        $scheme = substr($url, 0, strpos($url, ':'));
        if (strpos($scheme, '+')) {
            $scheme = substr($scheme, 0, strpos($scheme, '+'));
        }

        if (!$scheme) {
            throw new \Exception(sprintf('The url \'%s\' could not be parsed', $url));
        }

        if (isset(static::$schemeMap[$scheme])) {
            $className = static::$schemeMap[$scheme];
        } else {
            $className  = static::currentNamespace() . '\\' . ucfirst($scheme) . 'Dsn';
            if (!class_exists($className)) {
                $className  = static::currentClass();
            }
        }
        return new $className($url);
    }
public static function parse ( $ url ) { $ scheme = substr ( $ url , 0 , strpos ( $ url , ':' ) ) ; if ( strpos ( $ scheme , '+' ) ) { $ scheme = substr ( $ scheme , 0 , strpos ( $ scheme , '+' ) ) ; } if ( ! $ scheme ) { throw new \ Exception ( sprintf ( 'The url \'%s\' could not be parsed' , $ url ) ) ; } if ( isset ( static :: $ schemeMap [ $ scheme ] ) ) { $ className = static :: $ schemeMap [ $ scheme ] ; } else { $ className = static :: currentNamespace ( ) . '\\' . ucfirst ( $ scheme ) . 'Dsn' ; if ( ! class_exists ( $ className ) ) { $ className = static :: currentClass ( ) ; } } return new $ className ( $ url ) ; }
parse a dsn string into a dsn instance

If a more specific dsn class is available an instance of that class is returned

@param string $url
@return mixed Dsn instance or false
parse a dsn string into a dsn instance