Skip to content

Refactor HttpClient into native curl adapters for single and multi requests and deprecate php-curl-class #534

Description

@armanist

Summary

Refactor the current HttpClient package into a Quantum-owned curl transport layer with explicit native adapters for:

  • single requests
  • multi requests

As part of this work, deprecate php-curl-class/php-curl-class and move adapter behavior to native curl handling.

Why

Current state:

  • HttpClient depends directly on Curl\Curl and Curl\MultiCurl
  • single and multi behavior live in one mutable class
  • the package is shaped by a third-party API instead of Quantum-owned transport boundaries
  • several framework packages already rely on the current HttpClient surface

The goal is to replace that vendor-shaped design with native Quantum adapters and make the transport layer fully framework-owned.

Scope

This ticket should:

  • introduce explicit native adapters for single and multi curl execution
  • deprecate php-curl-class/php-curl-class
  • move current transport behavior to Quantum-owned native curl implementations
  • keep or redesign the HttpClient facade as needed around the new adapter structure

If this introduces breaking changes in the HTTP client layer, that is acceptable.

Proposed Changes

  • add explicit native curl adapters for single and multi request execution
  • remove vendor-shaped internals and dynamic passthrough behavior where possible
  • replace third-party client dependence with native curl handling
  • update current framework consumers to use the new internal architecture
  • preserve existing capabilities at the feature level where practical:
    • single requests
    • multi requests
    • async multi callbacks
    • normalized response and error handling

Acceptance Criteria

  • single and multi curl execution are represented by explicit native adapters
  • php-curl-class/php-curl-class is deprecated as part of the package direction
  • the framework is no longer architecturally centered on Curl\Curl / Curl\MultiCurl
  • internal consumers are updated to work with the new architecture
  • tests cover both single and multi adapter flows
  • docs are updated to reflect the new structure and any breaking API changes

Notes

Relevant code:

  • src/HttpClient/HttpClient.php
  • tests/Unit/HttpClient/HttpClientTest.php

Current internal consumers include:

  • Captcha
  • Mailer adapters
  • Storage cloud integrations

Metadata

Metadata

Assignees

No one assigned

    Labels

    httpHTTP transport, redirects, and request/response behavior

    Type

    No fields configured for Task.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions