diff options
author | Fabien Potencier <fabien.potencier@gmail.com> | 2011-02-21 17:26:35 +0100 |
---|---|---|
committer | Fabien Potencier <fabien.potencier@gmail.com> | 2011-02-21 17:36:04 +0100 |
commit | f9bd8d8dfb915e667a1c7315727d985748d695c6 (patch) | |
tree | 23d6285526457e13c601457d5879be23f9843669 /Http/EntryPoint | |
parent | c9cd5c60b7ee6a1eef90826a8f323b467c13b9f7 (diff) | |
download | symfony-security-f9bd8d8dfb915e667a1c7315727d985748d695c6.zip symfony-security-f9bd8d8dfb915e667a1c7315727d985748d695c6.tar.gz symfony-security-f9bd8d8dfb915e667a1c7315727d985748d695c6.tar.bz2 |
remove response as a service
The Response is not available in the DIC anymore.
When you need to create a response, create an instance of
Symfony\Component\HttpFoundation\Response instead.
As a side effect, the Controller::createResponse() and Controller::redirect()
methods have been removed and can easily be replaced as follows:
return $this->createResponse('content', 200, array('foo' => 'bar'));
return new Response('content', 200, array('foo' => 'bar'));
return $this->redirect($url);
return Response::createRedirect($url);
Diffstat (limited to 'Http/EntryPoint')
-rw-r--r-- | Http/EntryPoint/FormAuthenticationEntryPoint.php | 5 | ||||
-rw-r--r-- | Http/EntryPoint/RetryAuthenticationEntryPoint.php | 5 |
2 files changed, 2 insertions, 8 deletions
diff --git a/Http/EntryPoint/FormAuthenticationEntryPoint.php b/Http/EntryPoint/FormAuthenticationEntryPoint.php index 0993fa7..5809fe8 100644 --- a/Http/EntryPoint/FormAuthenticationEntryPoint.php +++ b/Http/EntryPoint/FormAuthenticationEntryPoint.php @@ -49,9 +49,6 @@ class FormAuthenticationEntryPoint implements AuthenticationEntryPointInterface return $event->getSubject()->handle(Request::create($this->loginPath), HttpKernelInterface::SUB_REQUEST); } - $response = new Response(); - $response->setRedirect(0 !== strpos($this->loginPath, 'http') ? $request->getUriForPath($this->loginPath) : $this->loginPath, 302); - - return $response; + return Response::createRedirect(0 !== strpos($this->loginPath, 'http') ? $request->getUriForPath($this->loginPath) : $this->loginPath, 302); } } diff --git a/Http/EntryPoint/RetryAuthenticationEntryPoint.php b/Http/EntryPoint/RetryAuthenticationEntryPoint.php index ed1297f..444535a 100644 --- a/Http/EntryPoint/RetryAuthenticationEntryPoint.php +++ b/Http/EntryPoint/RetryAuthenticationEntryPoint.php @@ -53,9 +53,6 @@ class RetryAuthenticationEntryPoint implements AuthenticationEntryPointInterface $url = $scheme.'://'.$request->getHost().$port.$request->getScriptName().$request->getPathInfo().$qs; - $response = new Response(); - $response->setRedirect($url, 301); - - return $response; + return Response::createRedirect($url, 301); } } |