/** * Return response from CI * * @param Request $request * * @return Response * * @throws \Exception */ public function getResponse(Request $request) { if (self::$ciLoaded) { throw new \Exception('Can not create response for CodeIgniter controller, because another controller was already loaded.'); } self::$ciLoaded = true; $this->unsetNoticeErrorLevel(); $this->setCiPaths($request); require_once __DIR__ . '/ci_bootstrap.php'; try { ob_start(); /* * -------------------------------------------------------------------- * LOAD THE BOOTSTRAP FILE * -------------------------------------------------------------------- * * And away we go... * */ \ci_bootstrap($this->kernel); $response = new Response(ob_get_clean()); } catch (\Exception $e) { ob_get_clean(); $handler = new ExceptionHandler(); $response = $handler->createResponse($e); } return $response; }
/** * Return response from CI * * @param Request $request * @return \Symfony\Component\HttpFoundation\Response * @throws Exception */ public function getResponse(Request $request) { if (self::$ci_loaded) { throw new \Exception('Can not create response for CodeIgniter controller, because another controller was already loaded.'); } self::$ci_loaded = true; $this->unsetNoticeErrorLevel(); $this->setCiPaths($request); require_once __DIR__ . '/ci_bootstrap.php'; ob_start(); /* * -------------------------------------------------------------------- * LOAD THE BOOTSTRAP FILE * -------------------------------------------------------------------- * * And away we go... * */ \ci_bootstrap($this->kernel); $output = ob_get_clean(); return new \Symfony\Component\HttpFoundation\Response($output); }