diff --git a/src/Symfony/Component/Routing/Loader/PhpFileLoader.php b/src/Symfony/Component/Routing/Loader/PhpFileLoader.php index d72d4de9277a..c018a69ffa18 100644 --- a/src/Symfony/Component/Routing/Loader/PhpFileLoader.php +++ b/src/Symfony/Component/Routing/Loader/PhpFileLoader.php @@ -35,9 +35,9 @@ public function load($file, $type = null) $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;