Closed
Description
Q | A |
---|---|
Bug report? | yes |
Feature request? | no |
BC Break report? | - |
RFC? | - |
Symfony version | 3.3.0-BETA1 |
Hello,
Following the guidelines for symfony/symfony-standard
, I put in config_dev.yml
framework:
router:
resource: "%kernel.project_dir%/app/config/routing_dev.yml"
strict_requirements: true
profiler: { only_exceptions: false }
When clearing the cache via cache:clear
it throws an exception because it tries to search for routing_dev.yml
in wrong location
[Symfony\Component\Config\Exception\FileLocatorFileNotFoundException]
The file "/var/cache/symfony/project/de_/config/routing_dev.yml" does not exist.
the path is clearly wrong, it should be, for my exemple : /srv/app
). If I dump the dump($this->getParameter('kernel.project_dir')
in a Controller, it returns /srv/app
which is right.
I'm running inside a VM, so I had to change cache & logs directories for performance:
// AppKernel.php
public function getCacheDir()
{
if (isset($_SERVER['VAGRANT']) && $_SERVER['VAGRANT']) {
return '/var/cache/symfony/project/'.$this->environment;
}
return dirname(__DIR__).'/var/cache/'.$this->getEnvironment();
}
public function getLogDir()
{
if (isset($_SERVER['VAGRANT']) && $_SERVER['VAGRANT']) {
return '/var/logs/symfony/project';
}
return dirname(__DIR__).'/var/logs';
}