Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Zend Psr7Bridge Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Usage

Converting a PSR-7 ServerRequestInterface to a Zend\Http\PhpEnvironment\Request

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:

  • the ServerRequestInterface instance to convert.
  • a boolean flag indicating whether or not to do a "shallow" conversion.

Shallow conversions omit:

  • body parameters ("post" in zend-http)
  • uploaded files
  • the body content

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.

Examples

Full conversion to zend-http request

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()
);

Shallow conversion to zend-http request

use Zend\Psr7Bridge\Psr7ServerRequest;

// Assume $router is a Zend\Router\Http\TreeRouteStack instance.
$match = $router->match(Psr7ServerRequest::toZend($request, true));
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle