try {
// Try to handle the request from within Symfony
$response = $kernel->handle($sfRequest, HttpKernelInterface::MASTER_REQUEST, false);
} catch (NotFoundHttpException $e) {
// handle legacy
$legacyHandler = $kernel->getContainer()->get('legacy.handler');
if (!$response = $legacyHandler->parse($sfRequest)) {
$legacyHandler->bootLegacy();
$logger = $kernel->getContainer()->get('logger');
$kernel->getContainer()->get('session')->save();
try {
require_once $legacyHandler->getLegacyPath();
$response = $legacyHandler->handleResponse();
} catch (\Exception $e) {
// In case we have an error in the legacy, we want to be able to
// have a nice error page instead of a blank page.
$response = $legacyHandler->handleException($e, $sfRequest);
}
}
}
theodo_evolution_legacy_wrapper:
root_dir: '%kernel.root_dir%/../legacy'
kernel:
id: theodo_evolution_legacy_wrapper.legacy_kernel.symfony14
options:
application: frontend
environment: '%kernel.environment%'
debug: '%kernel.debug%'