code/filesystem/locator/abstract.php
final public function locate($url)
    {
        $result = false;

        if(!isset($this->__location_cache[$url]))
        {
            $info = $this->parseUrl($url);

            //Find the file
            foreach($this->getPathTemplates($url) as $template)
            {
                $path = str_replace(
                    array('<Package>'     , '<Path>'     ,'<File>'      , '<Format>'     , '<Type>'),
                    array($info['package'], $info['path'], $info['file'], $info['format'], $info['type']),
                    $template
                );

                if ($results = glob($path))
                {
                    foreach($results as $file)
                    {
                        if($result = $this->realPath($file)) {
                            break (2);
                        }
                    }
                }
            }

            $this->__location_cache[$url] = $result;
        }

        return $this->__location_cache[$url];
    }
final public function locate($url)
    {
        $result = false;

        if(!isset($this->__location_cache[$url]))
        {
            $info = $this->parseUrl($url);

            //Find the file
            foreach($this->getPathTemplates($url) as $template)
            {
                $path = str_replace(
                    array('<Package>'     , '<Path>'     ,'<File>'      , '<Format>'     , '<Type>'),
                    array($info['package'], $info['path'], $info['file'], $info['format'], $info['type']),
                    $template
                );

                if ($results = glob($path))
                {
                    foreach($results as $file)
                    {
                        if($result = $this->realPath($file)) {
                            break (2);
                        }
                    }
                }
            }

            $this->__location_cache[$url] = $result;
        }

        return $this->__location_cache[$url];
    }
final public function locate ( $ url ) { $ result = false ; if ( ! isset ( $ this -> __location_cache [ $ url ] ) ) { $ info = $ this -> parseUrl ( $ url ) ; //Find the file foreach ( $ this -> getPathTemplates ( $ url ) as $ template ) { $ path = str_replace ( array ( '<Package>' , '<Path>' , '<File>' , '<Format>' , '<Type>' ) , array ( $ info [ 'package' ] , $ info [ 'path' ] , $ info [ 'file' ] , $ info [ 'format' ] , $ info [ 'type' ] ) , $ template ) ; if ( $ results = glob ( $ path ) ) { foreach ( $ results as $ file ) { if ( $ result = $ this -> realPath ( $ file ) ) { break ( 2 ) ; } } } } $ this -> __location_cache [ $ url ] = $ result ; } return $ this -> __location_cache [ $ url ] ; }
Locate the resource based on a url

@param  string $url  The resource url
@return string|false  The physical file path for the resource or FALSE if the url cannot be located
Locate the resource based on a url