2017 © Pedro Peláez
 

library http-factory

Lightweight autodiscovering PSR-17 HTTP factories

image

tuupola/http-factory

Lightweight autodiscovering PSR-17 HTTP factories

  • Wednesday, August 1, 2018
  • by tuupola
  • Repository
  • 1 Watchers
  • 8 Stars
  • 27,814 Installations
  • PHP
  • 11 Dependents
  • 1 Suggesters
  • 3 Forks
  • 1 Open issues
  • 7 Versions
  • 65 % Grown

The README.md

Autodiscovering PSR-17 HTTP Factories

Latest Version Software License Build Status Coverage, (*1)

Install

Install the library using Composer., (*2)

``` bash $ composer require tuupola/http-factory, (*3)

## Usage

Let's assume you have Diactoros installed.

$ composer require zendframework/zend-diactoros, (*4)


The factories will now automatically return Diactoros PSR-7 instances. ```php use Tuupola\Http\Factory\RequestFactory; $request = (new RequestFactory)->createRequest("GET", "https://example.com/"); print get_class($request); /* Zend\Diactoros\Request */

On the other hand if you have Slim frameworks installed., (*5)

$ composer remove zendframework/zend-diactoros
$ composer require slim/slim

The factories will now return Slim PSR-7 instances., (*6)

use Tuupola\Http\Factory\RequestFactory;

$request = (new RequestFactory)->createRequest("GET", "https://example.com/");
print get_class($request); /* Slim\Http\Request */

This library currently automatically detects and supports laminas/laminas-diactoros, zendframework/zend-diactoros, slim/slim, slim/psr7, nyholm/psr7 and guzzle/psr7 PSR-7 implementations., (*7)

Testing

You can run tests either manually or automatically on every code change. Automatic tests require entr to work., (*8)

``` bash $ make test, (*9)

``` bash
$ brew install entr
$ make watch

Contributing

Please see CONTRIBUTING for details., (*10)

Security

If you discover any security related issues, please email tuupola@appelsiini.net instead of using the issue tracker., (*11)

License

The MIT License (MIT). Please see License File for more information., (*12)

The Versions

01/08 2018

dev-released-psr-17

dev-released-psr-17 https://github.com/tuupola/http-factory

Lightweight autodiscovering PSR-17 HTTP factories

  Sources   Download

MIT

The Requires

 

The Development Requires

psr-7 http psr-17

09/01 2018
07/01 2018
01/06 2017

0.1.1

0.1.1.0 https://github.com/tuupola/http-factory

Lightweight autodiscovering PSR-17 HTTP factories

  Sources   Download

MIT

The Requires

 

The Development Requires

psr-7 http psr-17

30/05 2017

0.1.0

0.1.0.0 https://github.com/tuupola/http-factory

Lightweight autodiscovering PSR-17 HTTP factories

  Sources   Download

MIT

The Requires

 

The Development Requires

psr-7 http psr-17