Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/dceprojects.corals.io/vendor/league/glide/docs/1.0/config/integrations/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/dceprojects.corals.io/vendor/league/glide/docs/1.0/config/integrations/psr-7.md
---
layout: default
title: PSR-7 integration
---

# PSR-7 integration

Glide ships with the `PsrResponseFactory` class, allowing you to use any [PSR-7](http://www.php-fig.org/psr/psr-7/) compliant library. However, since Glide only depends on the PSR-7 interfaces, it cannot actually create the `Response` or `Stream` objects. Instead, you must provide them.

## Configuration

The following example uses the [Zend Diactoros](https://github.com/zendframework/zend-diactoros) library, but any PSR-7 compatible package will work.

~~~ php
<?php

use League\Glide\ServerFactory;
use League\Glide\Responses\PsrResponseFactory;
use Zend\Diactoros\Response;
use Zend\Diactoros\Stream;

$server = ServerFactory::create([
    'response' => new PsrResponseFactory(new Response(), function ($stream) {
        return new Stream($stream);
    }),
]);
~~~

## Vendor specific adapters

However, for simplicity, Glide provides a vendor specific PSR-7 adapters to make this easier:

- [Slim](/1.0/config/integrations/slim/)
- [Zend](/1.0/config/integrations/zend/)

Spamworldpro Mini