2017 © Pedro Peláez
 

library discovery

Finds installed HTTPlug implementations and PSR-7 message factories

image

php-http/discovery

Finds installed HTTPlug implementations and PSR-7 message factories

  • Tuesday, February 6, 2018
  • by egeloen
  • Repository
  • 8 Watchers
  • 215 Stars
  • 4,908,262 Installations
  • PHP
  • 286 Dependents
  • 6 Suggesters
  • 20 Forks
  • 0 Open issues
  • 24 Versions
  • 18 % Grown

The README.md

HTTPlug Discovery

Latest Version Software License Tests Code Coverage Quality Score Total Downloads, (*1)

This library provides auto-discovery and auto-installation of well-known PSR-17, PSR-18 and HTTPlug implementations., (*2)

Install

Via Composer, (*3)

``` bash composer require php-http/discovery, (*4)



## Usage as a library author Please see the [official documentation](http://php-http.readthedocs.org/en/latest/discovery.html). If your library/SDK needs a PSR-18 client, here is a quick example. First, you need to install a PSR-18 client and a PSR-17 factory implementations. This should be done only for dev dependencies as you don't want to force a specific implementation on your users: ```bash composer require --dev symfony/http-client composer require --dev nyholm/psr7

Then, you can disable the Composer plugin embeded in php-http/discovery because you just installed the dev dependencies you need for testing:, (*5)

composer config allow-plugins.php-http/discovery false

Finally, you need to require php-http/discovery and the generic implementations that your library is going to need:, (*6)

composer require 'php-http/discovery:^1.17'
composer require 'psr/http-client-implementation:*'
composer require 'psr/http-factory-implementation:*'

Now, you're ready to make an HTTP request:, (*7)

use Http\Discovery\Psr18Client;

$client = new Psr18Client();

$request = $client->createRequest('GET', 'https://example.com');
$response = $client->sendRequest($request);

Internally, this code will use whatever PSR-7, PSR-17 and PSR-18 implementations that your users have installed., (*8)

Usage as a library user

If you use a library/SDK that requires php-http/discovery, you can configure the auto-discovery mechanism to use a specific implementation when many are available in your project., (*9)

For example, if you have both nyholm/psr7 and guzzlehttp/guzzle in your project, you can tell php-http/discovery to use guzzlehttp/guzzle instead of nyholm/psr7 by running the following command:, (*10)

composer config extra.discovery.psr/http-factory-implementation GuzzleHttp\\Psr7\\HttpFactory

This will update your composer.json file to add the following configuration:, (*11)

{
    "extra": {
        "discovery": {
            "psr/http-factory-implementation": "GuzzleHttp\\Psr7\\HttpFactory"
        }
    }
}

Don't forget to run composer install to apply the changes, and ensure that the composer plugin is enabled:, (*12)

composer config allow-plugins.php-http/discovery true
composer install

Testing

bash composer test, (*13)

Contributing

Please see our contributing guide., (*14)

Security

If you discover any security related issues, please contact us at security@php-http.org., (*15)

License

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

The Versions

06/02 2018

dev-master

9999999-dev http://php-http.org

Finds installed HTTPlug implementations and PSR-7 message factories

  Sources   Download

MIT

The Requires

  • php ^5.5 || ^7.0

 

The Development Requires

by Márk Sági-Kazár

http psr7 client message factory adapter discovery

06/02 2018

1.4.0

1.4.0.0 http://php-http.org

Finds installed HTTPlug implementations and PSR-7 message factories

  Sources   Download

MIT

The Requires

  • php ^5.5 || ^7.0

 

The Development Requires

by Márk Sági-Kazár

http psr7 client message factory adapter discovery

19/08 2017

dev-all-psr4

dev-all-psr4 http://php-http.org

Finds installed HTTPlug implementations and PSR-7 message factories

  Sources   Download

MIT

The Requires

  • php ^5.5 || ^7.0

 

The Development Requires

by Márk Sági-Kazár

http psr7 client message factory adapter discovery

03/08 2017

1.3.0

1.3.0.0 http://php-http.org

Finds installed HTTPlug implementations and PSR-7 message factories

  Sources   Download

MIT

The Requires

  • php ^5.5 || ^7.0

 

The Development Requires

by Márk Sági-Kazár

http psr7 client message factory adapter discovery

02/03 2017

1.2.1

1.2.1.0 http://php-http.org

Finds installed HTTPlug implementations and PSR-7 message factories

  Sources   Download

MIT

The Requires

  • php ^5.5 || ^7.0

 

The Development Requires

by Márk Sági-Kazár

http psr7 client message factory adapter discovery

12/02 2017

1.2.0

1.2.0.0 http://php-http.org

Finds installed HTTPlug implementations and PSR-7 message factories

  Sources   Download

MIT

The Requires

  • php ^5.5 || ^7.0

 

The Development Requires

by Márk Sági-Kazár

http psr7 client message factory adapter discovery

27/11 2016

v1.1.1

1.1.1.0 http://php-http.org

Finds installed HTTPlug implementations and PSR-7 message factories

  Sources   Download

MIT

The Requires

  • php ^5.5 || ^7.0

 

The Development Requires

by Márk Sági-Kazár

http psr7 client message factory adapter discovery

20/10 2016

v1.1.0

1.1.0.0 http://php-http.org

Finds installed HTTPlug implementations and PSR-7 message factories

  Sources   Download

MIT

The Requires

  • php ^5.5 || ^7.0

 

The Development Requires

by Márk Sági-Kazár

http psr7 client message factory adapter discovery

18/07 2016

v1.0.0

1.0.0.0 http://php-http.org

Finds installed HTTPlug implementations and PSR-7 message factories

  Sources   Download

MIT

The Requires

  • php ^5.5 || ^7.0

 

The Development Requires

by Márk Sági-Kazár

http psr7 client message factory adapter discovery

28/06 2016

v0.9.1

0.9.1.0 http://php-http.org

Finds installed HTTPlug implementations and PSR-7 message factories

  Sources   Download

MIT

The Requires

  • php ^5.5|^7.0

 

The Development Requires

by Márk Sági-Kazár

http psr7 client message factory adapter discovery

25/06 2016

v0.9.0

0.9.0.0 http://php-http.org

Finds installed HTTPlug implementations and PSR-7 message factories

  Sources   Download

MIT

The Requires

  • php ^5.4 || ^7.0

 

The Development Requires

by Márk Sági-Kazár

http psr7 client message factory adapter discovery

11/02 2016

v0.8.0

0.8.0.0 http://httplug.io

Finds installed HTTPlug implementations and PSR-7 message factories

  Sources   Download

MIT

The Requires

  • php ^5.4|7.*

 

The Development Requires

by Márk Sági-Kazár

http client message factory adapter discovery

15/01 2016

v0.7.0

0.7.0.0 http://httplug.io

Finds installed HTTPlug implementations and PSR-7 message factories

  Sources   Download

MIT

The Requires

 

The Development Requires

by Márk Sági-Kazár

http client message factory adapter discovery

07/01 2016

v0.6.4

0.6.4.0 http://httplug.io

Finds installed HTTPlug implementations and PSR-7 message factories

  Sources   Download

MIT

The Requires

 

The Development Requires

by Márk Sági-Kazár

http client message factory adapter discovery

04/01 2016

v0.6.3

0.6.3.0 http://httplug.io

Finds installed HTTPlug implementations and PSR-7 message factories

  Sources   Download

MIT

The Requires

 

The Development Requires

by Márk Sági-Kazár

http client message factory adapter discovery

04/01 2016

v0.6.2

0.6.2.0 http://httplug.io

Finds installed HTTPlug implementations and PSR-7 message factories

  Sources   Download

MIT

The Requires

 

The Development Requires

by Márk Sági-Kazár

http client message factory adapter discovery

03/01 2016

v0.6.1

0.6.1.0 http://httplug.io

Finds installed HTTPlug implementations and PSR-7 message factories

  Sources   Download

MIT

The Requires

 

The Development Requires

by Márk Sági-Kazár

http client message factory adapter discovery

30/12 2015

v0.6.0

0.6.0.0 http://httplug.io

Finds installed HTTPlug implementations and PSR-7 message factories

  Sources   Download

MIT

The Requires

 

The Development Requires

by Márk Sági-Kazár

http client message factory adapter discovery

25/12 2015

v0.5.0

0.5.0.0 http://httplug.io

Finds installed HTTPlug implementations and PSR-7 message factories

  Sources   Download

MIT

The Requires

 

The Development Requires

by Márk Sági-Kazár
by Eric GELOEN

http client message factory adapter discovery

17/12 2015

v0.4.0

0.4.0.0 http://httplug.io

Finds installed HTTPlug implementations and PSR-7 message factories

  Sources   Download

MIT

The Requires

 

The Development Requires

by Márk Sági-Kazár
by Eric GELOEN

http client message factory adapter discovery

18/11 2015

v0.3.0

0.3.0.0 http://php-http.org

Finds installed clients and message factories

  Sources   Download

MIT

The Requires

 

The Development Requires

by Márk Sági-Kazár
by Eric GELOEN

http client message factory adapter discovery

31/10 2015

0.2.0

0.2.0.0 http://php-http.org

Finds installed adapters and message factories

  Sources   Download

MIT

The Requires

 

The Development Requires

by Márk Sági-Kazár
by Eric GELOEN

http message factory adapter discovery

13/06 2015

v0.1.1

0.1.1.0 http://php-http.org

Finds installed adapters and message factories

  Sources   Download

MIT

The Requires

 

The Development Requires

by Márk Sági-Kazár
by Eric GELOEN

http message factory adapter discovery

12/06 2015

v0.1.0

0.1.0.0 http://php-http.org

Finds installed adapters and message factories

  Sources   Download

MIT

The Requires

 

The Development Requires

by Márk Sági-Kazár
by Eric GELOEN

http message factory adapter discovery