浏览代码

[Routing] Fixing a bug where the current directory was set too late in the PhpFileLoader

Ryan Weaver 14 年之前
父节点
当前提交
4f0214eff4
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/Symfony/Component/Routing/Loader/PhpFileLoader.php

+ 1 - 1
src/Symfony/Component/Routing/Loader/PhpFileLoader.php

@@ -35,9 +35,9 @@ class PhpFileLoader extends FileLoader
         $loader = $this;
 
         $path = $this->locator->locate($file);
+        $this->setCurrentDir(dirname($path));
 
         $collection = include $path;
-        $this->setCurrentDir(dirname($path));
         $collection->addResource(new FileResource($path));
 
         return $collection;