protected function parseUrl($url)
    {
        if ($parsed = parse_url($url)) {
            return $this->addPassword($parsed);
        }

        // A second try for not file:// schemes which does support absolute
        // paths (like sqlite:///)

        // Cut the scheme by hand
        $parts = explode(':', $url, 2);

        if (count($parts) != 2 || strlen($parts[0]) > 24) {
            throw new InvalidArgumentException("Unparseable url $url");
        }

        // Now cheat parse_url by giving it a file url
        if (!$parsed = parse_url('file:'.$parts[1])) {
            throw new InvalidArgumentException("Unparseable url $url");
        }

        $parsed['scheme'] = $parts[0];

        return $this->addPassword($parsed);
    }
protected function parseUrl($url)
    {
        if ($parsed = parse_url($url)) {
            return $this->addPassword($parsed);
        }

        // A second try for not file:// schemes which does support absolute
        // paths (like sqlite:///)

        // Cut the scheme by hand
        $parts = explode(':', $url, 2);

        if (count($parts) != 2 || strlen($parts[0]) > 24) {
            throw new InvalidArgumentException("Unparseable url $url");
        }

        // Now cheat parse_url by giving it a file url
        if (!$parsed = parse_url('file:'.$parts[1])) {
            throw new InvalidArgumentException("Unparseable url $url");
        }

        $parsed['scheme'] = $parts[0];

        return $this->addPassword($parsed);
    }
protected function parseUrl ( $ url ) { if ( $ parsed = parse_url ( $ url ) ) { return $ this -> addPassword ( $ parsed ) ; } // A second try for not file:// schemes which does support absolute // paths (like sqlite:///) // Cut the scheme by hand $ parts = explode ( ':' , $ url , 2 ) ; if ( count ( $ parts ) != 2 || strlen ( $ parts [ 0 ] ) > 24 ) { throw new InvalidArgumentException ( "Unparseable url $url" ) ; } // Now cheat parse_url by giving it a file url if ( ! $ parsed = parse_url ( 'file:' . $ parts [ 1 ] ) ) { throw new InvalidArgumentException ( "Unparseable url $url" ) ; } $ parsed [ 'scheme' ] = $ parts [ 0 ] ; return $ this -> addPassword ( $ parsed ) ; }
Parses the url.

@param string $url

@return array
Parses the url .