PHP Classes

How to Access Resources using HTTP Compliant with PHP PSR 17 Standard using Fatfree PSR 17: Handle HTTP requests complying with PSR 17

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 31 All time: 11,135 This week: 43Up
Version License PHP version Categories
fatfree-psr7 1.0MIT/X Consortium ...8HTTP, PSR, PHP 8
Description 

Author

This package can handle HTTP requests complying with PSR 17.

It provides implementation classes for handling HTTP requests with interfaces defined by the PHP Framework Interoperability Group.

The package provides classes for:

- Storing HTTP message information

- Handling HTTP requests

- Generating HTTP responses

- Processing HTTP server requests

- Accessing HTTP servers as streams

- Manipulating URIs

- Handling file uploads

Picture of Christian Knuth
  Performance   Level  

 

Documentation

Fat-Free PSR-7 implementation

This is a lightweight PSR-7 implementation for PHP 8.0+.

Installation

composer require f3-factory/fatfree-psr7

Usage

The package includes a PSR-17 factory and also supports HTTPlug.

Use these factories according to specs to create Request, Response, Uri, Stream objects.

Tests

Run the test suite:

composer test

NB: Custom tests were mostly taken from Nyholm/psr7.

Benchmarks

Benchmarks done with devanych/psr-http-benchmark on php 8.0+.

Test results (Intel Xeon Gold 6140 CPU @ 2.30GHz, 4 cores):

| Runs: 50,000 | Guzzle | HttpSoft | Laminas | Nyholm | Slim | Fatfree | |----------------------|-----------|-----------|-----------|-----------|-----------|-----------| | Runs per second | 18599 | 31938 | 22601 | 27999 | 18789 | 35200 | | Average time per run | 0.0538 ms | 0.0313 ms | 0.0442 ms | 0.0357 ms | 0.0532 ms | 0.0284 ms | | Total time | 2.6882 s | 1.5655 s | 2.2122 s | 1.7858 s | 2.6611 s | 1.4204 s |


  Files folder image Files (28)  
File Role Description
Files folder imagesrc (1 directory)
Files folder imagetests (6 files, 3 directories)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file phpunit.xml.dist Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:31
This week:0
All time:11,135
This week:43Up