jakeasmith/http_build_url
Pure-PHP drop-in for the PECL HTTP extension's http_build_url(). Parse URLs into components and reassemble them reliably, handling schemes, hosts, paths, query strings, and fragments. Ideal for merging parameters or rebuilding relative URLs without needing the extension installed.
Architecture fit. jakeasmith/http_build_url is not a framework package — it is a single global function (http_build_url()) shipped via Composer's files autoload, recreating the PECL pecl_http helper for environments that lack that extension. There is no service provider, no facade, no config, no container binding, and no Laravel coupling of any kind. That makes it maximally compatible and minimally architecturally meaningful: it occupies the global namespace in an application that otherwise lives inside Laravel's container, and it duplicates capability already present in the stack (Illuminate\Support\Uri in Laravel 11+, GuzzleHttp\Psr7\Uri, or league/uri).
Integration feasibility. Installation is a one-line Composer require with zero configuration and zero transitive dependencies, so the mechanical effort is trivial. The real feasibility question is governance: the package is archived, deprecated by its own maintainer, and last released 2017-05-01. The deprecation notice explicitly redirects to PHP 8.5's Uri\Rfc3986\Uri. Any new adoption is therefore adopting a known-dead dependency with a pre-declared removal date.
Technical risk.
.., percent-encoding of already-encoded components).pecl_http's flag semantics (HTTP_URL_REPLACE, JOIN_PATH, JOIN_QUERY, STRIP_*) but is not guaranteed bit-identical, so behavior can differ from documentation or from any remaining PECL-based service.function_exists() guarding prevents a fatal redeclare if pecl_http is ever loaded, but that also means the polyfill silently becomes a no-op and behavior shifts to the extension's implementation.composer.json PHP constraint predates PHP 8.x, so it will install but is undeclared against modern runtimes.Key questions.
Uri class obviates this package entirely.Illuminate\Support\Uri or PSR-7?route(), url(), or Guzzle's base_uri resolution should own?Stack fit. Poor for greenfield. In a Laravel codebase the idiomatic alternatives dominate: route()/url() for application URLs, Illuminate\Support\Uri (Laravel 11+) or GuzzleHttp\Psr7\Uri/UriResolver for programmatic composition, and Guzzle's base_uri for relative resolution. The polyfill only earns its place as a compatibility shim for legacy code or a transitive dependency that already calls http_build_url().
Migration path. Treat it as containment, not adoption:
http_build_url( call site plus any vendor package that requires it; classify each by flags used.UriBuilder (or UrlComposer) service so no application code calls the global function directly. This is the decisive step — it converts an unmaintainable global into a swappable interface.pecl_http flags to concrete operations on Uri (replace components, merge paths, merge/filter query strings, strip fragments). Flag parity is where regressions hide; encode it as test fixtures.Uri\Rfc3986\Uri (or Illuminate\Support\Uri) once the runtime supports it.Compatibility. No framework conflicts; safe alongside Laravel, Guzzle, and PSR-7. The only hard constraint is the undeclared PHP 8.x support and the possibility of pecl_http coexistence — both are edge cases, not blockers. Watch for encoded-URL double-encoding differences at the boundary between this function and Guzzle.
Sequencing. Do not bundle the swap with other work. Phase 1: introduce the abstraction with the polyfill as its implementation, ship, and add characterization tests around every call site. Phase 2 (independent, low-risk): replace call sites one domain at a time — routing, outbound HTTP client config, integrations. Phase 3: upgrade the implementation to the native class on a PHP 8.5 runtime; Phase 4: drop the package. If the dependency is transitive and immovable, skip to vendoring instead (see below).
Maintenance. Effectively zero upstream. Any defect becomes our defect. Mitigating factor: the surface is a single small file, so vendoring a fork into the repo is a cheap and defensible containment strategy — it removes the abandoned-package flag from dependency review, gives us patch rights, and costs little to maintain. Choosing to keep pulling from Packagist while archived is the worse option; it is unmaintained and outside our control.
Support. No maintainer, no issue triage, no CVE response. Because there is no I/O, no eval, and no deserialization, the realistic vulnerability class is near-empty; the exposure is correctness, not compromise. Expect recurring friction with SCA tooling and dependency-policy reviews flagging "archived/deprecated" — budget for a documented exception with a named owner and an expiry date tied to the PHP 8.5 upgrade.
Scaling. Negligible. It is pure CPU string manipulation with no allocation-heavy behavior beyond building the result string; it will not be a throughput bottleneck. The scaling concern is organizational: every engineer who touches it must learn flag semantics that exist nowhere else in the stack, and that knowledge does not transfer to the replacement.
Failure modes.
.. path segments not collapsed, query parameters reordered or double-encoded, fragments lost. Silent, not loud: the URL still parses, it just points somewhere wrong. This is the dominant risk and the reason for characterization tests.pecl_http when the extension is present (the guard disables the polyfill).composer dump-autoload runs with --no-dev/optimized settings after the package is dropped from require but call sites remain, the failure is a clean "undefined function" fatal and is caught in CI, which is the benign case.Ramp-up. Essentially none to use — the API is one function with a flags argument, and an engineer is productive in minutes. That is precisely the trap: low ramp-up encourages ad-hoc URL string assembly that bypasses Laravel's routing layer, which is a bigger long-term liability than the dependency itself. Pair any adoption with a lint rule or code-review guideline directing engineers to route()/Uri first.
TPM recommendation. Do not adopt for new work. If already present, contain it behind an internal abstraction, characterization-test the flag semantics, vendor a fork if the dependency cannot be removed promptly, and schedule removal against the PHP 8.5 migration that makes Uri\Rfc3986\Uri available natively.
How can I help you explore Laravel packages today?