Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/biurad/php-http-galaxy
🪐 A library that provides functionality for http pipelines: psr-7, psr-13, psr-15, psr-17, Cors, CSP, session and cookies manipulations.
https://github.com/biurad/php-http-galaxy
biurad cookie guzzle guzzlehttp http http-factories php psr-13 psr-17 psr15 psr7 session
Last synced: 3 days ago
JSON representation
🪐 A library that provides functionality for http pipelines: psr-7, psr-13, psr-15, psr-17, Cors, CSP, session and cookies manipulations.
- Host: GitHub
- URL: https://github.com/biurad/php-http-galaxy
- Owner: biurad
- License: bsd-3-clause
- Created: 2019-12-17T02:01:41.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-06-18T00:37:14.000Z (5 months ago)
- Last Synced: 2024-08-15T11:13:30.396Z (3 months ago)
- Topics: biurad, cookie, guzzle, guzzlehttp, http, http-factories, php, psr-13, psr-17, psr15, psr7, session
- Language: PHP
- Homepage:
- Size: 383 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# The Poakium Http Galaxy
[![Latest Version](https://img.shields.io/packagist/v/biurad/http-galaxy?include_prereleases&label=Latest&style=flat-square)](https://packagist.org/packages/biurad/http-galaxy)
[![Workflow Status](https://img.shields.io/github/actions/workflow/status/biurad/poakium/ci.yml?branch=master&label=Workflow&style=flat-square)](https://github.com/biurad/poakium/actions?query=workflow)
[![Software License](https://img.shields.io/badge/License-BSD--3-brightgreen.svg?&label=Poakium&style=flat-square)](LICENSE)
[![Maintenance Status](https://img.shields.io/maintenance/yes/2023?label=Maintained&style=flat-square)](https://github.com/biurad/poakium)---
A [PHP][1] library that designed to provide [PSR-7][2], [PSR-15][3] and [PSR-17][4] seamless integration with [symfony/http-foundation][5] for your projects.
## 📦 Installation
This project requires [PHP][1] 7.4 or higher. The recommended way to install, is via [Composer][6]. Simply run:
```bash
$ composer require biurad/http-galaxy
```## 📍 Quick Start
Since [symfony/http-foundation][5] library is a standard on it's own, libraries which relies on PHP-FIG standard makes it difficult to integrate with. With this library you can safely use PHP-FIG standards with good performance. build quickly using HTTP Galaxy.
Here is an example of how to use the library:
```php
use Biurad\Http\Factory\Psr17Factory;
use Biurad\Http\Middlewares\PrepareResponseMiddleware;
use Biurad\Http\Response;
use Laminas\Stratigility\Middleware\CallableMiddlewareDecorator;
use Laminas\Stratigility\MiddlewarePipe;
use Psr\Http\Message\{ResponseInterface, ServerRequestInterface};
use Psr\Http\Server\RequestHandlerInterface;// Create a PSR-7 Request
$request = Psr17Factory::fromGlobalRequest();// Create a PSR-15 Request Handler
$dispatcher = new MiddlewarePipe();
$dispatcher->pipe(new PrepareResponseMiddleware());
$dispatcher->pipe(
new CallableMiddlewareDecorator(
function (ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface {
// Apply middleware logic here
return $handler->handle($request);
}
)
);// A request handler handling application's logic
$handler = new \App\MyRequestHandler();// Process the request handler and middleware(s)
$response = $dispatcher->process($request, $handler);
\assert($response instanceof Response);// Send the response to the client from symfony's response object
$response->getResponse()->send();
```## 📓 Documentation
In-depth documentation on how to use this library can be found at [docs.biurad.com][7]. It is also recommended to browse through unit tests in the [tests](./tests/) directory.
## 🙌 Sponsors
If this library made it into your project, or you interested in supporting us, please consider [donating][8] to support future development.
## 👥 Credits & Acknowledgements
- [Divine Niiquaye Ibok][9] is the author this library.
- [All Contributors][10] who contributed to this project.## 📄 License
Poakium HTTP Galaxy is completely free and released under the [BSD 3 License](LICENSE).
[1]: https://php.net
[2]: http://www.php-fig.org/psr/psr-7/
[3]: http://www.php-fig.org/psr/psr-15/
[4]: http://www.php-fig.org/psr/psr-17/
[5]: https://github.com/symfony/http-foundation
[6]: https://getcomposer.org
[7]: https://docs.biurad.com/poakium/http-galaxy
[8]: https://biurad.com/sponsor
[9]: https://github.com/divineniiquaye
[10]: https://github.com/biurad/php-http-galaxy/contributors