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

TODO #7

Open
ncou opened this issue Jan 21, 2019 · 0 comments
Open

TODO #7

ncou opened this issue Jan 21, 2019 · 0 comments

Comments

@ncou
Copy link
Owner

ncou commented Jan 21, 2019

Possibilité de rajouter une fonction insertAtIndex() => https://github.com/fratily/http/blob/master/src/Server/RequestHandler.php

Exemple :
https://github.com/zer0php/middleware/blob/master/src/Pipe/MiddlewarePipe.php

Améliorer le LazyLoadingMiddleware en utilisant cet exemple :
https://github.com/zendframework/zend-expressive/blob/master/src/MiddlewareContainer.php#L62
https://github.com/zendframework/zend-expressive/blob/491da1e365d54e467026641b5984c0dd181ebe90/src/Middleware/LazyLoadingMiddleware.php

ajouter les fonction : insertAt, insertBefore....etc :
https://github.com/cakephp/cakephp/blob/master/src/Http/MiddlewareQueue.php

Prepare middleware => factory :
https://github.com/zendframework/zend-expressive/blob/master/src/MiddlewareFactory.php#L130

Exemple de LazyMiddleware :
https://github.com/northwoods/lazy-middleware/blob/master/src/LazyMiddleware.php
https://github.com/zendframework/zend-expressive/blob/master/src/Middleware/LazyLoadingMiddleware.php

TODO : Dans le LazyMiddleware si le container retourne un objet instanceof RequestHandlerInterface ET que ce n'est pas un instanceOf Middleware, dans ce cas on appelera la méthode handle() au lieu de process !!!!
https://github.com/zendframework/zend-expressive/blob/master/src/MiddlewareContainer.php#L66

TODO : créer une méthode "run(array $middlewares, $request, $response) pour empiler les middleware plus la réponse à la fin et executer le handler avec la request en paramétre ?????

Inspiration : Queue => https://github.com/Nyholm/SuperSlim/blob/master/src/Runner.php

TODO : ajouter un clonage de la classe Pipeline dans la méthode "pipe()" ????
https://github.com/thephpleague/pipeline/blob/master/src/Pipeline.php#L26

Utiliser un objet SPLQueue :
https://github.com/zendframework/zend-stratigility/blob/master/src/MiddlewarePipe.php
https://github.com/sunrise-php/http-router/blob/master/src/RequestHandler.php

Exemple avec l'utilisation du RequestHandlerInterface+MiddlewareInterface dans la même classe :
https://github.com/ztsu/reacon/blob/master/src/Reacon.php#L66
https://github.com/alexpts/psr15-next/blob/master/src/Extra/PipeStack.php#L33
https://github.com/zendframework/zend-stratigility/blob/master/src/MiddlewarePipe.php#L81
https://github.com/ellipsephp/middleware/blob/master/src/MiddlewareStack.php

Exemple :
https://github.com/spiral/http/blob/master/src/Pipeline.php

Relay
https://github.com/relayphp/Relay.Relay/blob/2.x/src/Relay.php
https://github.com/relayphp/Relay.Relay/blob/2.x/src/Runner.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant