This repository was archived by the owner on May 30, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the HTTP client by introducing a new CurlClient that leverages libcurl for improved performance and feature support, while keeping backward compatibility with the existing SocketClient. Key changes include:
- Adding the CurlClient class with a new event loop and cURL callbacks.
- Updating tests and client references to support both CurlClient and SocketClient.
- Refactoring several client usages and documentation to reflect the new design.
Reviewed Changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
components/HttpClient/Tests/* | Updated tests to reference the new client classes and expected cURL error messages. |
components/HttpClient/Response.php | Updated constructor signature and added header parsing improvements to support HTTP/2.0 responses. |
components/HttpClient/Client/CurlClient.php | Introduced the CurlClient implementation with cURL multi-handle management and callbacks. |
components/Blueprints/* | Updated type hints from Client to SocketClient to align with the client changes. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds a CurlClient class to benefit from
libcurl
when available:Motivateion
Curl is faster than
stream_socket_*
functions and supports more HTTP features (e.g. HTTP 2.0).Implementation
Before this PR there was a single
Client
class that usedstream_socket_*
functions for managing HTTP connections.After this PR there's:
Client
abstract class withClient::create( $options )
method.SocketClient
– the previousClient
class.CurlClient
– the new libcurl-based HTTP client.The event-based API remains the same. Both clients pass a similar test suite.
Testing instructions
Confirm the tests worked