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   View files Documentation   View files View files (28)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 27 All time: 11,054 This week: 191Up
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  
Name: Christian Knuth <contact>
Classes: 1 package by
Country: Germany Germany
Age: ???
All time rank: 4510238 in Germany Germany
Week rank: 364 Up15 in Germany Germany Up

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  
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

  Files folder image Files  /  src  
File Role Description
Files folder imageHttp (7 files, 1 directory)

  Files folder image Files  /  src  /  Http  
File Role Description
Files folder imageFactory (2 files)
  Plain text file Message.php Class Class source
  Plain text file Request.php Class Class source
  Plain text file Response.php Class Class source
  Plain text file ServerRequest.php Class Class source
  Plain text file Stream.php Class Class source
  Plain text file UploadedFile.php Class Class source
  Plain text file Uri.php Class Class source

  Files folder image Files  /  src  /  Http  /  Factory  
File Role Description
  Plain text file HTTPlug.php Class Class source
  Plain text file Psr17Factory.php Class Class source

  Files folder image Files  /  tests  
File Role Description
Files folder imageFactory (2 files)
Files folder imageIntegration (6 files)
Files folder imageResources (1 file)
  Plain text file RequestTest.php Class Class source
  Plain text file ResponseTest.php Class Class source
  Plain text file ServerRequestTest.php Class Class source
  Plain text file StreamTest.php Class Class source
  Plain text file UploadedFileTest.php Class Class source
  Plain text file UriTest.php Class Class source

  Files folder image Files  /  tests  /  Factory  
File Role Description
  Plain text file HttplugFactoryTest.php Class Class source
  Plain text file Psr17FactoryTest.php Class Class source

  Files folder image Files  /  tests  /  Integration  
File Role Description
  Plain text file RequestTest.php Class Class source
  Plain text file ResponseTest.php Class Class source
  Plain text file ServerRequestTest.php Class Class source
  Plain text file StreamTest.php Class Class source
  Plain text file UploadedFileTest.php Class Class source
  Plain text file UriTest.php Class Class source

  Files folder image Files  /  tests  /  Resources  
File Role Description
  Accessible without login Plain text file foo.txt Doc. Documentation

 Version Control Unique User Downloads Download Rankings  
 100%
Total:27
This week:0
All time:11,054
This week:191Up