Skip to content

http-message-strategies-interop/symfony-httpinterop-bridge

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HMS fork of thecodingmachine/symfony-httpinterop-bridge

Bridges between Symfony HttpKernel and HTTP Message Strategies (PSR pre-Draft)

Those adapters are built on top of the existing symfony/psr-http-message-bridge that bridges Symfony and PSR-7 HTTP messages.

This bridge is currently based on Common interfaces for HTTP Message Strategies. As this is in an early stage, this might be subject to change!

Usage

By default, the Symfony HttpFoundation and HttpKernel are used. For PSR-7, the Zend-Diactoros implementation is used. These implementations can be changed if needed.

Wrapping a HttpKernel

// Use the HttpInteropToSymfonyBridge adapter
$requestHandlerStrategy = new HttpInteropToSymfonyBridge($yourHttpKernel);

// Handling PSR-7 requests
$psr7Response = $requestHandlerStrategy($psr7Request);

Wrapping a PSR-7 callback

// Use the SymfonyToHttpInteropBridge adapter
$symfonyKernel = new SymfonyToHttpInteropBridge($yourServerRequestHandler);

// Handling Symfony requests
$symfonyResponse = $symfonyKernel->handle($symfonyRequest);

Related

About

A bridge between Symfony HttpKernel and ServerRequestHandler Strategy.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%