code/libraries/joomlatools/component/koowa/template/locator/file.php
public function find(array $info)
    {
        //Qualify partial templates.
        if(dirname($info['url']) === '.')
        {
            if(empty($info['base'])) {
                throw new RuntimeException('Cannot qualify partial template path');
            }

            $relative_path = dirname($info['base']);
        }
        else $relative_path = dirname($info['url']);

        $file   = pathinfo($info['url'], PATHINFO_FILENAME);
        $format = pathinfo($info['url'], PATHINFO_EXTENSION);

        $base_paths = array(JPATH_ROOT);

        if (!empty($this->_override_paths)) {
            foreach ($this->_override_paths as $override_path) {
                array_unshift($base_paths, $override_path);
            }
        }

        foreach ($base_paths as $base_path)
        {
            $path = $base_path.'/'.str_replace(parse_url($relative_path, PHP_URL_SCHEME).'://', '', $relative_path);

            // Remove /view from the end of the override path
            if (in_array($base_path, KObjectConfig::unbox($this->_override_paths)) && substr($path, strrpos($path, '/')) === '/view') {
                $path = substr($path, 0, -5);
            }

            if(!$result = $this->realPath($path.'/'.$file.'.'.$format))
            {
                $pattern = $path.'/'.$file.'.'.$format.'.*';
                $results = glob($pattern);

                //Try to find the file
                if ($results)
                {
                    foreach($results as $file)
                    {
                        if($result = $this->realPath($file)) {
                            return $result;
                        }
                    }
                }
            }
        }

        return $result;
    }
public function find(array $info)
    {
        //Qualify partial templates.
        if(dirname($info['url']) === '.')
        {
            if(empty($info['base'])) {
                throw new RuntimeException('Cannot qualify partial template path');
            }

            $relative_path = dirname($info['base']);
        }
        else $relative_path = dirname($info['url']);

        $file   = pathinfo($info['url'], PATHINFO_FILENAME);
        $format = pathinfo($info['url'], PATHINFO_EXTENSION);

        $base_paths = array(JPATH_ROOT);

        if (!empty($this->_override_paths)) {
            foreach ($this->_override_paths as $override_path) {
                array_unshift($base_paths, $override_path);
            }
        }

        foreach ($base_paths as $base_path)
        {
            $path = $base_path.'/'.str_replace(parse_url($relative_path, PHP_URL_SCHEME).'://', '', $relative_path);

            // Remove /view from the end of the override path
            if (in_array($base_path, KObjectConfig::unbox($this->_override_paths)) && substr($path, strrpos($path, '/')) === '/view') {
                $path = substr($path, 0, -5);
            }

            if(!$result = $this->realPath($path.'/'.$file.'.'.$format))
            {
                $pattern = $path.'/'.$file.'.'.$format.'.*';
                $results = glob($pattern);

                //Try to find the file
                if ($results)
                {
                    foreach($results as $file)
                    {
                        if($result = $this->realPath($file)) {
                            return $result;
                        }
                    }
                }
            }
        }

        return $result;
    }
public function find ( array $ info ) { //Qualify partial templates. if ( dirname ( $ info [ 'url' ] ) === '.' ) { if ( empty ( $ info [ 'base' ] ) ) { throw new RuntimeException ( 'Cannot qualify partial template path' ) ; } $ relative_path = dirname ( $ info [ 'base' ] ) ; } else $ relative_path = dirname ( $ info [ 'url' ] ) ; $ file = pathinfo ( $ info [ 'url' ] , PATHINFO_FILENAME ) ; $ format = pathinfo ( $ info [ 'url' ] , PATHINFO_EXTENSION ) ; $ base_paths = array ( JPATH_ROOT ) ; if ( ! empty ( $ this -> _override_paths ) ) { foreach ( $ this -> _override_paths as $ override_path ) { array_unshift ( $ base_paths , $ override_path ) ; } } foreach ( $ base_paths as $ base_path ) { $ path = $ base_path . '/' . str_replace ( parse_url ( $ relative_path , PHP_URL_SCHEME ) . '://' , '' , $ relative_path ) ; // Remove /view from the end of the override path if ( in_array ( $ base_path , KObjectConfig :: unbox ( $ this -> _override_paths ) ) && substr ( $ path , strrpos ( $ path , '/' ) ) === '/view' ) { $ path = substr ( $ path , 0 , - 5 ) ; } if ( ! $ result = $ this -> realPath ( $ path . '/' . $ file . '.' . $ format ) ) { $ pattern = $ path . '/' . $ file . '.' . $ format . '.*' ; $ results = glob ( $ pattern ) ; //Try to find the file if ( $ results ) { foreach ( $ results as $ file ) { if ( $ result = $ this -> realPath ( $ file ) ) { return $ result ; } } } } } return $ result ; }
Find a template override

@param array  $info      The path information
@return bool|mixed
Find a template override