symfony/symfony — Issue #2747: [HttpKernel] Support for relative paths in the Kernel and in the Container
Author: lisachenko
Created: 2011-11-29 11:42:48+00:00
State: open

There is a big problem to build a site in a temporary directory, warm up the cache for production mode on the build server and then rsyncing it to the production server into another directory.

Problem here is that the Kernel uses abosulte path for root dir. I tried to override rootDir in my AppKernel to the relative like 'app', but got errors in the FileLocator->locale method. Then I tried to override getContainerLoader method in the kernel to add extra relative paths to the constructor of FileLocator. This gives no result because there are many places where FileLocator is used in application without relative paths and all paths from reflection is also absolute.

So, there is only one way to do what we need: to sed all cache and replace absolute paths to relative.