php-http/guzzle5-adapter
PHP-HTTP adapter that lets you use Guzzle 5 as the underlying HTTP client. It implements the PHP-HTTP client interfaces for sending requests and handling responses, making it useful for legacy projects already built on Guzzle 5.
Recommendation: Treat php-http/guzzle5-adapter as a transitional compatibility shim only. Do not adopt it for new Laravel packages or greenfield services. Its only defensible use case is a legacy Laravel/PHP application already locked to Guzzle 5 that must consume a library requiring the HTTPlug Http\Client\HttpClient contract.
Architecture fit: Poor for modern Laravel. Laravel’s HTTP client is built on Guzzle 7 and the ecosystem has moved to PSR-18/PSR-17. This adapter targets HTTPlug, the predecessor to PSR-18, and bridges to Guzzle 5, which is end-of-life. It fits only as an anti-corruption layer between a legacy Guzzle 5 transport and modern HTTPlug-dependent libraries. It should not appear in a package’s public API or be a hard dependency of a distributed Laravel package; the consuming application should choose the implementation.
Integration feasibility: Composer installation is mechanically feasible, but practical feasibility is constrained by Guzzle 5 and PHP-version compatibility. Expect dependency conflicts with modern Laravel, Guzzle 6/7, PSR-18 libraries, and packages requiring current PHP. There is no Laravel service-provider integration, so the team must wire the adapter into the container and isolate it behind an internal HTTP interface. Contract and regression tests are mandatory because PSR-7/Guzzle 5 conversion behavior is not guaranteed across streaming, headers, redirects, cookies, timeouts, and exception mapping.
Technical risk: High.
Key questions:
php-http/client-implementation, and can it be replaced with a PSR-18 client?Stack fit: Low. Modern Laravel packages should depend on psr/http-client and use PSR-18/PSR-17 discovery. This adapter should be required only by the legacy application, not by a reusable Laravel package. If a package currently type-hints HTTPlug, refactor toward PSR-18 first; use this adapter only as a temporary application-level bridge.
Migration path:
guzzlehttp/guzzle:^5, php-http/client-implementation, HTTPlug consumers, and any existing HTTP abstractions.Http\Client\HttpClient to the adapter in a service provider, keeping Guzzle 5 construction and adapter configuration out of domain code.Compatibility: Expect friction with Laravel 7+ HTTP client usage because Laravel’s Http facade does not consume HTTPlug adapters directly. Calls must go through the application’s bound HTTPlug client. Do not assume compatibility with current PHP 8.x releases without verification. MIT licensing is acceptable, but archived status and unknown repository provenance require internal review.
Sequencing: Start with dependency and risk discovery, not installation. Prototype in a disposable branch or spike environment. If the spike passes, integrate behind an interface with tests and an owner. Schedule the exit migration before broad rollout; do not let the adapter enter shared package dependencies or long-lived platform contracts.
Maintenance: High burden relative to value. The package is archived, so the organization must own patching, compatibility fixes, and vulnerability response. Plan for a maintained fork or vendor patch set if usage extends beyond a short migration window. Add it to the software-composition analysis exception register with an expiry date.
Support: Low external support. There is no active upstream maintainer, no guaranteed issue triage, and limited documentation. Internal runbooks must cover adapter configuration, Guzzle 5 transport settings, error mapping, and rollback. Teams should know that failures may require debugging both HTTPlug/PSR-7 and Guzzle 5 semantics.
Scaling: The adapter itself is unlikely to be the primary bottleneck, but Guzzle 5’s blocking request model and older connection handling limit high-throughput or async workloads. It is unsuitable for new high-scale services. For batch jobs, set explicit timeouts, concurrency limits, and memory controls; test large payloads and streamed responses.
Failure modes: Expect conversion defects around streamed bodies, header casing/duplication, redirects, cookies, multipart uploads, exception translation, timeout handling, TLS/proxy changes, and PHP deprecation warnings. Dependency conflicts can break builds. Archived dependencies can fail security audits. Monitor adapter-specific exceptions, HTTP error-rate changes, latency, memory, and Composer audit findings.
Ramp-up: The API surface is small, so initial developer ramp-up is moderate. The harder cost is legacy context: engineers must understand Guzzle 5, HTTPlug, PSR-7 conversion behavior, and the application’s historical HTTP assumptions. Provide an architecture decision record, a short integration guide, contract tests, and a named owner. Keep the exit plan visible: this package buys migration time, not a stable long-term platform capability.
How can I help you explore Laravel packages today?