Download the PHP package vaibhavpandeyvpz/vidyut without Composer
On this page you can find all versions of the php package vaibhavpandeyvpz/vidyut. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vaibhavpandeyvpz/vidyut
More information about vaibhavpandeyvpz/vidyut
Files in vaibhavpandeyvpz/vidyut
Package vidyut
Short Description No frills PSR-7 request handler based on PSR-15 specification.
License MIT
Homepage https://github.com/vaibhavpandeyvpz/vidyut
Informations about the package vidyut
Vidyut
No frills PSR-7 request handler based on PSR-15 specification.
Vidyut (
विद्युत्) - Sanskrit for "Electricity", representing the flow of requests through the middleware pipeline.
Features
- ✅ PSR-15 Compliant - Full implementation of the PSR-15 middleware specification
- ✅ PSR-7 Compatible - Works with any PSR-7 HTTP message implementation
- ✅ Flexible Middleware - Supports both
MiddlewareInterfaceinstances and callables - ✅ Fluent Interface - Chain middleware using the
pipe()method - ✅ Zero Dependencies - Only requires PSR interfaces (PSR-7, PSR-15)
- ✅ Modern PHP - Built for PHP 8.2+ with modern language features
- ✅ 100% Test Coverage - Fully tested with comprehensive test suite
Installation
Install via Composer:
Note: You'll also need a PSR-7 implementation. We recommend sandesh:
Quick Start
Usage
Basic Pipeline
The Pipeline class implements the PSR-15 RequestHandlerInterface and allows you to chain middleware:
Constructor Injection
You can also pass middleware directly to the constructor:
Middleware Types
Callable Middleware
Callables must accept two parameters:
ServerRequestInterface $requestRequestHandlerInterface $delegate
And return a ResponseInterface:
MiddlewareInterface Instances
You can use any class implementing Psr\Http\Server\MiddlewareInterface:
Array Callables
You can also use array callables:
Request Modification
Middleware can modify the request before passing it to the next handler:
Response Modification
Middleware can modify the response after receiving it from the next handler:
Early Termination
Middleware can stop the pipeline by returning a response without calling the delegate:
Fluent Interface
The pipe() method returns the pipeline instance, allowing method chaining:
Requirements
- PHP 8.2 or higher
- A PSR-7 implementation (e.g., sandesh)
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Support
For issues, questions, or contributions, please visit the GitHub repository.
All versions of vidyut with dependencies
psr/http-message Version ^1.0 || ^2.0
psr/http-server-handler Version ^1.0
psr/http-server-middleware Version ^1.0