コード例 #1
0
 /**
  * @TODO use the passed params rather than route matching
  * a second time in symfony.
  *
  * @param array $params
  */
 public function dispatchRouteToSymfony($params)
 {
     //        $loader = require_once __DIR__.'/../SymfonyRoot/app/bootstrap.php.cache';
     //        $apcLoader = new ApcClassLoader('SymfonizeZf', $loader);
     //        $loader->unregister();
     //        $apcLoader->register(true);
     //@TODO get ProductionCheck out of here
     $kernel = new SymfonizeKernel(ProductionCheck::onLocal() ? 'dev' : 'prod', ProductionCheck::onLocal());
     $kernel->loadClassCache();
     $request = Request::createFromGlobals();
     $response = $kernel->handle($request);
     $response->send();
     $kernel->terminate($request, $response);
     exit;
 }
コード例 #2
0
 /**
  * This function has Symfony handle the incoming request.
  *
  * @TODO investigate improving performance by un-commenting the caching below
  */
 public function dispatchRouteToSymfony()
 {
     //        $loader = require_once __DIR__.'/../SymfonyRoot/app/bootstrap.php.cache';
     //        $apcLoader = new ApcClassLoader('SymfonizeZF', $loader);
     //        $loader->unregister();
     //        $apcLoader->register(true);
     $kernel = new SymfonizeKernel(Module::$symfonizeConfig['environment'], Module::$symfonizeConfig['debug']);
     if (!Module::$symfonizeConfig['debug']) {
         $kernel->loadClassCache();
     }
     $request = Request::createFromGlobals();
     $response = $kernel->handle($request);
     $response->send();
     $kernel->terminate($request, $response);
     //Do not run the rest of ZF since Symfony is handling this request.
     exit;
 }