nyholm/psr7
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
psr/http-factory | 1.0.2 | 5.44 kB | MIT | prod |
Nyholm/psr7 is a super lightweight PHP7 implementation of PSR-7 (PHP Standard Recommendation 7). It is designed to be very fast and very strict, providing an exact implementation of the PSR-7 specification without any extra features or helper methods. This package is beneficial for developers aiming to build scalable and high-performance applications with PHP.
To effectively use Nyholm/psr7, start by installing it via composer with the command composer require nyholm/psr7
. This package is used to create PSR-7 compliant objects such as requests, streams, and URIs.
For instance, you can create a request object in the following way:
$psr17Factory = new \Nyholm\Psr7\Factory\Psr17Factory();
$request = $psr17Factory->createRequest('GET', 'http://tnyholm.se');
$stream = $psr17Factory->createStream('foobar');
To send a request, you can use any PSR-18 (HTTP client) you prefer like HTTPlug. Additionally, the nyholm/psr7-server
package can be used to create server requests from PHP superglobals. Responses can be emitted using the laminas/laminas-httphandlerrunner
package.
The primary source of documentation for Nyholm/psr7 is the PSR-7 specification itself, as this package aims to be a strict implementation of it. The README on the GitHub repository also contains useful information on installation and basic usage. The package maintainers, Tobias Nyholm and Martijn van der Ven, are committed to keeping this library concise and adhering strictly to the PSR-7 specification, meaning there are no extra classes or functions beyond what is required by the standard.