Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Http Build Url Laravel Package

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.

Deep Wiki
Context7

Technical Evaluation

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.

  • Abandonment: no upstream fixes for URL-parsing edge cases (IPv6 literals, userinfo, default-port normalization, relative-path resolution with .., percent-encoding of already-encoded components).
  • Parity gap: the polyfill approximates 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.
  • Namespace collision: correct defensive 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.
  • Stale platform metadata: the composer.json PHP constraint predates PHP 8.x, so it will install but is undeclared against modern runtimes.
  • Low exploitability: pure in-memory string manipulation, no I/O, no deserialization, no network surface — so the security blast radius is small even though the package is unmaintained.

Key questions.

  1. Which PHP version is the target? If 8.5+ is on the roadmap, the built-in Uri class obviates this package entirely.
  2. Is the dependency direct or transitive (i.e., pulled in by a third-party SDK we cannot easily change)?
  3. Which call sites use flag-based composition that has no one-to-one equivalent in Illuminate\Support\Uri or PSR-7?
  4. Does our SCA/policy tooling block archived or "unmaintained" packages, and is an exception being requested?
  5. Is there a real need to compose URLs at all, or are we hand-building URLs that route(), url(), or Guzzle's base_uri resolution should own?
  6. Who owns the replacement if upstream never ships a fix — do we vendor a fork (~single file) or migrate?

Integration Approach

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:

  1. Inventory every http_build_url( call site plus any vendor package that requires it; classify each by flags used.
  2. Abstract behind a first-party 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.
  3. Map semantics: build a small table from 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.
  4. Swap implementations behind the abstraction — polyfill today, native Uri\Rfc3986\Uri (or Illuminate\Support\Uri) once the runtime supports it.
  5. Remove the dependency and the global function from the autoload surface.

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).

Operational Impact

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.

  • Silent misassembly — dropped default ports, .. 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.
  • Behavior drift versus pecl_http when the extension is present (the guard disables the polyfill).
  • Autoload regression — if 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.
  • Vendor lock-in — a third-party SDK requiring it silently pins our PHP roadmap.

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels
wazza/laravel-db-encryption
hokny/laravel-generator
vonsogt/backup
jengo/queues
jeremykenedy/laravel-observability
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums