Skip to content

Commit

Permalink
HTTP API: Deprecate WP_Http_Curl and WP_Http_Streams classes.
Browse files Browse the repository at this point in the history
These classes have not been used in WordPress Core since the Requests library was introduced in [37428]. These classes are now deprecated in favor of `WP_Http`.

There are two remaining spots in Core that reference these classes:
- The `WP_Http::_dispatch_request()` method, which was marked as deprecated in favor of `WP_Http::request()` in [42766]/[44346].
- The `WP_Http::_get_first_available_transport()`.

That latter is now also marked as deprecated in favor of `\WpOrg\Requests\Requests::get_transport_class()`.

Props SergeyBiryukov, rajinsharwar, hellofromTonya.
Fixes #58705.

git-svn-id: https://develop.svn.wordpress.org/trunk@56655 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
desrosj committed Sep 21, 2023
1 parent b9adbb3 commit 58d47f5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/wp-includes/class-wp-http-curl.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* Requires the Curl extension to be installed.
*
* @since 2.7.0
* @deprecated 6.4.0 Use WP_Http
* @see WP_Http
*/
#[AllowDynamicProperties]
class WP_Http_Curl {
Expand Down
2 changes: 2 additions & 0 deletions src/wp-includes/class-wp-http-streams.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
*
* @since 2.7.0
* @since 3.7.0 Combined with the fsockopen transport and switched to `stream_socket_client()`.
* @deprecated 6.4.0 Use WP_Http
* @see WP_Http
*/
#[AllowDynamicProperties]
class WP_Http_Streams {
Expand Down
2 changes: 2 additions & 0 deletions src/wp-includes/class-wp-http.php
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,8 @@ public static function validate_redirects( $location ) {
* Tests which transports are capable of supporting the request.
*
* @since 3.2.0
* @deprecated 6.4.0 Use WpOrg\Requests\Requests::get_transport_class()
* @see WpOrg\Requests\Requests::get_transport_class()
*
* @param array $args Request arguments.
* @param string $url URL to request.
Expand Down

0 comments on commit 58d47f5

Please sign in to comment.