berlioz / http-message
Berlioz HTTP Message is a PHP library whose implements PSR-7 (HTTP message interfaces) and PSR-17 (HTTP Factories) standards.
Installs: 25 135
Dependents: 7
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: ^8.0
- ext-fileinfo: *
- berlioz/helpers: ^1.5
- psr/http-factory: ^1.0
- psr/http-message: ^1.0 || ^2.0
Requires (Dev)
- http-interop/http-factory-tests: ^0.7
- phpunit/phpunit: ^9.3
Suggests
- ext-zlib: To use GzStream
Provides
README
Berlioz HTTP Message is a PHP library whose implements PSR-7 (HTTP message interfaces) and PSR-17 (HTTP Factories) standards.
Installation
Composer
You can install Berlioz HTTP Message with Composer, it's the recommended installation.
$ composer require berlioz/http-message
Dependencies
- PHP ^8.0
- PHP libraries:
- fileinfo
- Packages:
- psr/http-message
- psr/http-factory
Usage
Global
Looks at PSR documentations:
- PSR-7 (HTTP message interfaces): https://www.php-fig.org/psr/psr-7/
- PSR-17 (HTTP Factories): https://www.php-fig.org/psr/psr-17/
Factory
Only one factory class implements the PSR-17:
\Berlioz\Http\Message\HttpFactory
To help you, the factory is cut into some traits:
\Berlioz\Http\Message\Factory\RequestFactoryTrait
\Berlioz\Http\Message\Factory\ResponseFactoryTrait
\Berlioz\Http\Message\Factory\ServerRequestFactoryTrait
\Berlioz\Http\Message\Factory\StreamFactoryTrait
\Berlioz\Http\Message\Factory\UploadedFileFactoryTrait
\Berlioz\Http\Message\Factory\UriFactoryTrait