php - Zend Framework 1 app inside Symfony2 -
php - Zend Framework 1 app inside Symfony2 -
i'm thinking of migrating big web app zend framework 1 symfony 2. need done in way allow maintenance , feature additions zf1 app, thought way forwards embed zf1 app within symfony2 project can move functionality 1 other.
my question how go sensibly. prove concept work i've modified phone call $kernel->handle()
in app.php
exceptions not caught, , i've caught notfoundhttpexception
, used invoke zf front end controller (see code below), feels horrible hack. what's improve way accomplish this?
app_dev.php: ... seek { $kernel = new appkernel('dev', true); $kernel->loadclasscache(); $request = request::createfromglobals(); $response = $kernel->handle($request, null, false); // don't handle exceptions $response->send(); $kernel->terminate($request, $response); } grab (notfoundhttpexception $e) { require_once 'index.php'; // dispatch zf1 app }
i've implemented nicer solution doing along lines of what's described here: http://marcjschmidt.de/blog/2013/11/30/symfony-custom-dynamic-router.html, i.e. implementing custom event handler kernel.request
delegates zf1 app if route isn't found.
it still works catching notfoundhttpexception
, isn't quite such hack.
is there improve way delegate zf1 app when routes aren't found symfony2 catching exception? using exception switch status doesn't seem nice.
php symfony2 zend-framework
Comments
Post a Comment