-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Description
In the Kernel
class, the return value of the getRootDir()
method is normalized (str_replace('\\', '/', …)
).
public function getRootDir()
{
if (null === $this->rootDir) {
$r = new \ReflectionObject($this);
$this->rootDir = str_replace('\\', '/', dirname($r->getFileName()));
}
return $this->rootDir;
}
However, in the app*DebugProjectContainer
class, it is not:
public function __construct()
{
$dir = __DIR__;
for ($i = 1; $i <= 5; ++$i) {
$this->targetDirs[$i] = $dir = dirname($dir);
}
…
}
protected function getDefaultParameters()
{
return array(
'kernel.root_dir' => $this->targetDirs[2],
…
}
On Windows, this means that $kernel->getRootDir()
outputs something different than $container->getParameter('kernel.root_dir)
.
echo $kernel->getRootDir();
// C:/xampp/htdocs/symfony-standard
echo $container->getParameter('kernel.root_dir');
// C:\xampp\htdocs\symfony-standard
I'd happily create a PR, however I am not sure how to solve the problem. Should the path normalization in the getRootDir()
method be removed or should the cache class be adjusted?
Metadata
Metadata
Assignees
Labels
No labels