Discovery automates the process of finding and configuring HTTP client implementations in PHP projects. It simplifies dependency management by allowing libraries to utilize any installed PSR-7, PSR-17, or PSR-18 compliant HTTP client without explicit configuration. This is accomplished through a Composer plugin that intelligently searches for and loads appropriate implementations.
This project streamlines HTTP client selection, reducing the need for manual configuration and improving code portability across different HTTP client implementations. It supports PSR-17 and PSR-18 standards, facilitating interoperability with various HTTP client libraries. The Composer plugin provides a convenient way to integrate discovery into existing projects with minimal overhead.
- PSR-17 Client Discovery: Automatically finds and loads PSR-17 compliant HTTP client implementations.
- PSR-18 Client Discovery: Supports the discovery and utilization of PSR-18 compatible HTTP client implementations.
- Configuration Override: Allows users to specify a preferred PSR-18 client implementation via Composer configuration.
- Composer Plugin: Integrates seamlessly with Composer for easy installation and automatic client discovery.
- Simple Usage: Provides a straightforward API for creating HTTP requests using discovered client implementations.
- Extensible: Designed to support future updates to the PSR standards and new HTTP client implementations.
- Testable: Includes unit tests to ensure the reliability and correctness of the discovery mechanism.
The Discovery library is a stable and actively maintained component of the PHP-HTTP project. It has a well-defined release cycle, regular updates, and a responsive community. The project has a significant number of stars and forks on GitHub, indicating widespread adoption and community support.
Developers benefit from Discovery by simplifying HTTP client management and reducing dependencies on specific HTTP client implementations. It's valuable for libraries that need flexibility in choosing an HTTP client or for projects aiming for greater compatibility. Discovery improves developer experience by automating configuration and promoting code reusability.
