Skip to content
Permalink
Browse files

Merge 7690364 into 5e4e4fe

  • Loading branch information...
willemwollebrants committed Sep 25, 2018
2 parents 5e4e4fe + 7690364 commit f71bd1d8c345cc77faa95ca8f70abdef9b5f5524
@@ -24,7 +24,8 @@
"intervention/image": "^2.1",
"league/flysystem": "^1.0",
"php": "^5.4 | ^7.0",
"psr/http-message": "^1.0"
"psr/http-message": "^1.0",
"psr/http-factory": "^1.0"
},
"require-dev": {
"mockery/mockery": "~0.9",

Some generated files are not rendered by default. Learn more.

@@ -31,4 +31,20 @@ $server = ServerFactory::create([
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/)
- [Zend](/1.0/config/integrations/zend/)

## Using a PSR-17 ResponseFactory
[PSR-17](https://www.php-fig.org/psr/psr-17/) describes a common standard for factories that create PSR-7 compliant objects.

The following example uses the [Zend Diactoros](https://github.com/http-interop/http-factory-diactoros) factory, but any PSR-17 compatible package will work.
~~~ php
<?php
use League\Glide\ServerFactory;
use League\Glide\Responses\Psr17ResponseFactory;
use Http\Factory\Diactoros\ResponseFactory;
$server = ServerFactory::create([
'response' => new Psr17ResponseFactory(new ResponseFactory()),
]);
~~~
@@ -41,4 +41,8 @@ interface ResponseFactoryInterface
*/
public function create(FilesystemInterface $cache, $path);
}
~~~
~~~

## Using PSR-17 response factories

[PSR-17](https://www.php-fig.org/psr/psr-17/) describes a common standard for factories that create PSR-7 compliant objects. The base package provides the `Psr17ResponseFactory` wrapper as a convenient way to use any PSR-17 compatible `ResponseFactoryInterface` with Glide.

0 comments on commit f71bd1d

Please sign in to comment.
You can’t perform that action at this time.