code/filesystem/locator/abstract.php
public function parseUrl($url)
    {
        $scheme   = parse_url($url, PHP_URL_SCHEME);
        $domain   = parse_url($url, PHP_URL_HOST);
        $basename = pathinfo($url, PATHINFO_BASENAME);

        $parts = explode('.', $basename);

        if(count($parts) == 3)
        {
            $type  =  array_pop($parts);
            $format = array_pop($parts);
            $file   = array_pop($parts);
        }
        else
        {
            $type   = '*';
            $format = array_pop($parts);
            $file   = array_pop($parts);
        }

        $path = str_replace(array($scheme.'://', $scheme.':'), '', dirname($url));

        if (strpos($path, $domain.'/') === 0) {
            $path = substr($path, strlen($domain)+1);
        }

        $parts = explode('/', $path);

        $info = array(
            'type'    => $type,
            'domain'  => $domain,
            'package' => array_shift($parts),
            'path'    => implode('/', $parts),
            'file'    => $file,
            'format'  => $format ?: '*',
        );

        return $info;
    }
public function parseUrl($url)
    {
        $scheme   = parse_url($url, PHP_URL_SCHEME);
        $domain   = parse_url($url, PHP_URL_HOST);
        $basename = pathinfo($url, PATHINFO_BASENAME);

        $parts = explode('.', $basename);

        if(count($parts) == 3)
        {
            $type  =  array_pop($parts);
            $format = array_pop($parts);
            $file   = array_pop($parts);
        }
        else
        {
            $type   = '*';
            $format = array_pop($parts);
            $file   = array_pop($parts);
        }

        $path = str_replace(array($scheme.'://', $scheme.':'), '', dirname($url));

        if (strpos($path, $domain.'/') === 0) {
            $path = substr($path, strlen($domain)+1);
        }

        $parts = explode('/', $path);

        $info = array(
            'type'    => $type,
            'domain'  => $domain,
            'package' => array_shift($parts),
            'path'    => implode('/', $parts),
            'file'    => $file,
            'format'  => $format ?: '*',
        );

        return $info;
    }
public function parseUrl ( $ url ) { $ scheme = parse_url ( $ url , PHP_URL_SCHEME ) ; $ domain = parse_url ( $ url , PHP_URL_HOST ) ; $ basename = pathinfo ( $ url , PATHINFO_BASENAME ) ; $ parts = explode ( '.' , $ basename ) ; if ( count ( $ parts ) == 3 ) { $ type = array_pop ( $ parts ) ; $ format = array_pop ( $ parts ) ; $ file = array_pop ( $ parts ) ; } else { $ type = '*' ; $ format = array_pop ( $ parts ) ; $ file = array_pop ( $ parts ) ; } $ path = str_replace ( array ( $ scheme . '://' , $ scheme . ':' ) , '' , dirname ( $ url ) ) ; if ( strpos ( $ path , $ domain . '/' ) === 0 ) { $ path = substr ( $ path , strlen ( $ domain ) + 1 ) ; } $ parts = explode ( '/' , $ path ) ; $ info = array ( 'type' => $ type , 'domain' => $ domain , 'package' => array_shift ( $ parts ) , 'path' => implode ( '/' , $ parts ) , 'file' => $ file , 'format' => $ format ? : '*' , ) ; return $ info ; }
Parse the url

@param  string $url The language url
@return array
Parse the url