zendframework/zend-psr7bridge
Bridge between Zend Diactoros HTTP messages and PSR-7 interfaces. Provides factories and converters to create, wrap, and translate requests, responses, streams, and uploaded files for interoperability across PSR-7 compatible middleware and apps.
The PSR-7 ServerRequestInterface corresponds to the zend-http PhpEnvironment\Request.
To convert from a PSR-7 instance to a zend-http instance, use
Zend\Psr7Bridge\Psr7ServerRequest::toZend(). This method takes up to two
arguments:
ServerRequestInterface instance to convert.Shallow conversions omit:
It is useful to omit these for purposes of routing, for instance, when you may
not need this more process-intensive data. By default, the $shallow flag is
false, meaning a full conversion is done.
use Zend\Http\PhpEnvironment\Response;
use Zend\Psr7Bridge\Psr7ServerRequest;
// Assume $controller is a Zend\Mvc\Controller\AbstractController instance.
$result = $controller->dispatch(
Psr7ServerRequest::toZend($request),
new Response()
);
use Zend\Psr7Bridge\Psr7ServerRequest;
// Assume $router is a Zend\Router\Http\TreeRouteStack instance.
$match = $router->match(Psr7ServerRequest::toZend($request, true));
How can I help you explore Laravel packages today?