Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Laminas as example server #661

Merged
merged 1 commit into from
Mar 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions website/docs/other-frameworks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ $builder->useAutomaticPersistedQueries($cache, new DateInterval('PT1H'));

In this example, we will focus on getting a working version of GraphQLite using:

- [Zend Stratigility](https://docs.zendframework.com/zend-stratigility/) as a PSR-15 server
- [Laminas Stratigility](https://docs.laminas.dev/laminas-stratigility/) as a PSR-15 server
- `mouf/picotainer` (a micro-container) for the PSR-11 container
- `symfony/cache ` for the PSR-16 cache

Expand All @@ -189,9 +189,9 @@ The choice of the libraries is really up to you. You can adapt it based on your
},
"require": {
"thecodingmachine/graphqlite": "^4",
"zendframework/zend-diactoros": "^2",
"zendframework/zend-stratigility": "^3",
"zendframework/zend-httphandlerrunner": "^1.0",
"laminas/laminas-diactoros": "^2",
"laminas/laminas-stratigility": "^3",
"laminas/laminas-httphandlerrunner": "^2",
"mouf/picotainer": "^1.1",
"symfony/cache": "^4.2"
},
Expand All @@ -206,11 +206,11 @@ The choice of the libraries is really up to you. You can adapt it based on your
use Laminas\Diactoros\Response;
use Laminas\Diactoros\ServerRequest;
use Laminas\Diactoros\ServerRequestFactory;
use Zend\HttpHandlerRunner\Emitter\SapiStreamEmitter;
use Zend\Stratigility\Middleware\ErrorResponseGenerator;
use Zend\Stratigility\MiddlewarePipe;
use Laminas\HttpHandlerRunner\Emitter\SapiStreamEmitter;
use Laminas\Stratigility\Middleware\ErrorResponseGenerator;
use Laminas\Stratigility\MiddlewarePipe;
use Laminas\Diactoros\Server;
use Zend\HttpHandlerRunner\RequestHandlerRunner;
use Laminas\HttpHandlerRunner\RequestHandlerRunner;

require_once __DIR__ . '/vendor/autoload.php';

Expand All @@ -232,7 +232,7 @@ $runner = new RequestHandlerRunner(
$runner->run();
```

Here we are initializing a Zend `RequestHandler` (it receives requests) and we pass it to a Zend Stratigility `MiddlewarePipe`.
Here we are initializing a Laminas `RequestHandler` (it receives requests) and we pass it to a Laminas Stratigility `MiddlewarePipe`.
This `MiddlewarePipe` comes from the container declared in the `config/container.php` file:

```php title="config/container.php"
Expand All @@ -245,7 +245,7 @@ use Psr\SimpleCache\CacheInterface;
use Symfony\Component\Cache\Simple\ApcuCache;
use TheCodingMachine\GraphQLite\Http\Psr15GraphQLMiddlewareBuilder;
use TheCodingMachine\GraphQLite\SchemaFactory;
use Zend\Stratigility\MiddlewarePipe;
use Laminas\Stratigility\MiddlewarePipe;

// Picotainer is a minimalist PSR-11 container.
return new Picotainer([
Expand Down
Loading