예제 #1
0
 /**
  * {@inheritdoc}
  */
 public function handleRequest(RequestInterface $request)
 {
     $symfonyRequest = $request->getHttpFoundationRequest();
     $symfonyResponse = $this->kernel->handle($symfonyRequest);
     $this->kernel->terminate($symfonyRequest, $symfonyResponse);
     return $symfonyResponse;
 }
 /**
  * Renders the given route with the given parameter.
  *
  * @param Route  $route     Route.
  * @param string $name      Name of the route; the default value is `null`.
  * @param array  $parameter Array of parameters; the default value is an empty array.
  *
  * @return void
  */
 protected function renderWithParameters(Route $route, $name = null, array $parameter = array())
 {
     $request = $this->buildRequest($route, $name, $parameter);
     $response = $this->kernel->handle($request);
     $content = $response->getContent();
     $this->kernel->terminate($request, $response);
     $this->kernel->shutdown();
     if (null !== $name) {
         $filename = $this->router->generate($name, $parameter);
     } else {
         $filename = $route->getPath();
     }
     $this->writer->write($filename, $content);
 }
예제 #3
0
 /**
  * @When the kernel terminates
  */
 public function theKernelTerminates()
 {
     $request = Request::create('/', 'GET');
     $response = $this->kernel->handle($request);
     $this->kernel->terminate($request, $response);
 }
예제 #4
0
 public function terminate(\Symfony\Component\HttpFoundation\Request $request, \Symfony\Component\HttpFoundation\Response $response)
 {
     return parent::terminate($request, $response);
     // TODO: Change the autogenerated stub
 }