Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 20, 2024 via composer

php-http/discovery 1.19.2

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations
Package summary
Share
0
issues
1
license
1
MIT
Package created
2 Jun 2015
Version published
30 Nov 2023
Maintainers
4
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
php-http/discovery@1.19.2
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of php-http/discovery 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does php-http/discovery do?

The php-http/discovery package is a library that provides automated discovery and installation of renowned PSR-17, PSR-18, and HTTPlug implementations. This facilitates the use of these standard HTTP message interfaces in your PHP projects, simplifying the development process by allowing interoperability between different PHP libraries.

How do you use php-http/discovery?

To use php-http/discovery, start by installing the package via Composer using the following command:

composer require php-http/discovery

Once installed, you can leverage php-http/discovery in your library or SDK. Here's a quick guide on how to use a PSR-18 client with the package:

First, install a PSR-18 client and a PSR-17 factory implementation as dev dependencies:

composer require --dev symfony/http-client
composer require --dev nyholm/psr7

Next, disable the Composer plugin embedded in php-http/discovery using the following command:

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

Then, add php-http/discovery and the generic implementations your library requires:

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

Now, you can create an HTTP request as follows:

use Http\Discovery\Psr18Client;

$client = new Psr18Client();

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

The above code will utilize any PSR-7, PSR-17, and PSR-18 implementations that your users have installed in the background.

Where are the php-http/discovery docs?

The comprehensive documentation for php-http/discovery can be found on the official PHP-HTTP documentation site. The documentation provides deeper insights into using the package, including usage as both a library author and a library user.