1
0
mirror of https://github.com/flarum/core.git synced 2025-10-10 22:44:25 +02:00

Upgrade Zend Diactoros to 1.1

This gives us a bunch of handy helper classes for empty responses,
redirects, HTML and JSON content types.

Closes flarum/core#153
This commit is contained in:
Franz Liedke
2015-06-26 22:34:34 +02:00
parent e18d8b35e5
commit 391c510f90
10 changed files with 92 additions and 53 deletions

View File

@@ -2,7 +2,8 @@
use Illuminate\Contracts\Bus\Dispatcher;
use Psr\Http\Message\ServerRequestInterface as Request;
use Zend\Diactoros\Response;
use Zend\Diactoros\Response\EmptyResponse;
use Zend\Diactoros\Response\RedirectResponse;
abstract class Action
{
@@ -22,7 +23,7 @@ abstract class Action
protected function success()
{
return new Response();
return new EmptyResponse();
}
/**
@@ -44,7 +45,7 @@ abstract class Action
</body>
</html>', htmlspecialchars($url, ENT_QUOTES, 'UTF-8'));
$response = new Response('php://memory', 302, ['location' => $url]);
$response = new RedirectResponse($url);
$response->getBody()->write($content);
return $response;