Symfony\Component\Routing\Loader\FileLoader::getAbsolutePath PHP Method

getAbsolutePath() protected method

protected getAbsolutePath ( $file, $currentPath = null )
    protected function getAbsolutePath($file, $currentPath = null)
    {
        if (self::isAbsolutePath($file)) {
            return $file;
        } else if (null !== $currentPath && file_exists($currentPath.DIRECTORY_SEPARATOR.$file)) {
            return $currentPath.DIRECTORY_SEPARATOR.$file;
        } else {
            foreach ($this->paths as $path) {
                if (file_exists($path.DIRECTORY_SEPARATOR.$file)) {
                    return $path.DIRECTORY_SEPARATOR.$file;
                }
            }
        }

        return $file;
    }

Usage Example

コード例 #1
0
ファイル: FileLoaderTest.php プロジェクト: notbrain/symfony
 public function getAbsolutePath($file, $currentPath = null)
 {
     return parent::getAbsolutePath($file, $currentPath);
 }