From 1d665546d2a4c1a59bd3688279b320d546771ab9 Mon Sep 17 00:00:00 2001 From: Divine Niiquaye Ibok Date: Mon, 10 Jul 2023 10:18:20 +0000 Subject: [PATCH] Update README.md --- README.md | 130 +++++++++++++++++++++++++++--------------------------- 1 file changed, 64 insertions(+), 66 deletions(-) diff --git a/README.md b/README.md index 38783e1..1112b1d 100644 --- a/README.md +++ b/README.md @@ -1,93 +1,91 @@
-# The PHP HTTP GALAXY +# The Poakium Http Galaxy -[![PHP Version](https://img.shields.io/packagist/php-v/biurad/http-galaxy.svg?style=flat-square&colorB=%238892BF)](http://php.net) -[![Latest Version](https://img.shields.io/packagist/v/biurad/php-http-galaxy.svg?style=flat-square)](https://packagist.org/packages/biurad/php-http-galaxy) -[![Workflow Status](https://img.shields.io/github/workflow/status/biurad/php-http-galaxy/build?style=flat-square)](https://github.com/biurad/php-http-galaxy/actions?query=workflow%3Abuild) -[![Code Maintainability](https://img.shields.io/codeclimate/maintainability/biurad/php-http-galaxy?style=flat-square)](https://codeclimate.com/github/biurad/php-http-galaxy) -[![Coverage Status](https://img.shields.io/codecov/c/github/biurad/php-http-galaxy?style=flat-square)](https://codecov.io/gh/biurad/php-http-galaxy) -[![Quality Score](https://img.shields.io/scrutinizer/g/biurad/php-http-galaxy.svg?style=flat-square)](https://scrutinizer-ci.com/g/biurad/php-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)
--- -**biurad/http-galaxy** is a fast, and simple [PSR-7] implementation for [PHP] 7.2+ based on [symfony/http-foundation] created by [Divine Niiquaye][@divineniiquaye]. This library seeks to add [PSR-7] support directly to [symfony/http-foundation] allowing the developer accessing both objects in one. It also shipped with [PSR-15] and [PSR-17] support. +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 & Basic Usage +## πŸ“¦ Installation -This project requires [PHP] 7.3 or higher. The recommended way to install, is via [Composer]. Simply run: +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 ``` -## πŸ““ Documentation - -For in-depth documentation before using this library.. Full documentation on advanced usage, configuration, and customization can be found at [docs.biurad.com][docs]. - -## ⏫ Upgrading - -Information on how to upgrade to newer versions of this library can be found in the [UPGRADE]. - -## 🏷️ Changelog - -[SemVer](http://semver.org/) is followed closely. Minor and patch releases should not introduce breaking changes to the codebase; See [CHANGELOG] for more information on what has changed recently. - -Any classes or methods marked `@internal` are not intended for use outside of this library and are subject to breaking changes at any time, so please avoid using them. - -## πŸ› οΈ Maintenance & Support - -(This policy may change in the future and exceptions may be made on a case-by-case basis.) - -- A new **patch version released** (e.g. `1.0.10`, `1.1.6`) comes out roughly every month. It only contains bug fixes, so you can safely upgrade your applications. -- A new **minor version released** (e.g. `1.1`, `1.2`) comes out every six months: one in June and one in December. It contains bug fixes and new features, but it doesn’t include any breaking change, so you can safely upgrade your applications; -- A new **major version released** (e.g. `1.0`, `2.0`, `3.0`) comes out every two years. It can contain breaking changes, so you may need to do some changes in your applications before upgrading. - -When a **major** version is released, the number of minor versions is limited to five per branch (X.0, X.1, X.2, X.3 and X.4). The last minor version of a branch (e.g. 1.4, 2.4) is considered a **long-term support (LTS) version** with lasts for more that 2 years and the other ones cam last up to 8 months: - -**Get a professional support from [Biurad Lap][] after the active maintenance of a released version has ended**. - -## πŸ§ͺ Testing - -```bash -$ ./vendor/bin/phpunit +## πŸ“ 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(); ``` -This will tests biurad/http-galaxy will run against PHP 7.3 version or higher. - -## πŸ›οΈ Governance - -This project is primarily maintained by [Divine Niiquaye Ibok][@divineniiquaye]. Contributions are welcome πŸ‘·β€β™€οΈ! To contribute, please familiarize yourself with our [CONTRIBUTING] guidelines. +## πŸ““ Documentation -To report a security vulnerability, please use the [Biurad Security](https://security.biurad.com). We will coordinate the fix and eventually commit the solution in this project. +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 -Are you interested in sponsoring development of this project? Reach out and support us on [Patreon](https://www.patreon.com/biurad) or see for a list of ways to contribute. +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][@divineniiquaye] -- [All Contributors][] +- [Divine Niiquaye Ibok][9] is the author this library. +- [All Contributors][10] who contributed to this project. ## πŸ“„ License -The **biurad/http-galaxy** library is copyright Β© [Divine Niiquaye Ibok](https://divinenii.com) and licensed for use under the [![Software License](https://img.shields.io/badge/License-BSD--3-brightgreen.svg?style=flat-square)](LICENSE). - -[PHP]: https://php.net -[PSR-7]: http://www.php-fig.org/psr/psr-7/ -[PSR-15]: http://www.php-fig.org/psr/psr-15/ -[PSR-17]: http://www.php-fig.org/psr/psr-17/ -[symfony/http-foundation]: https://github.com/symfony/http-foundation -[@divineniiquaye]: https://github.com/divineniiquaye -[docs]: https://docs.biurad.com/php/http-galaxy -[commit]: https://commits.biurad.com/flight-routing.git -[UPGRADE]: UPGRADE.md -[CHANGELOG]: CHANGELOG.md -[CONTRIBUTING]: ./.github/CONTRIBUTING.md -[All Contributors]: https://github.com/divineniiquaye/php-rade/contributors -[Biurad Lap]: https://team.biurad.com -[email]: support@biurad.com -[message]: https://projects.biurad.com/message +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