Skip to content

Commit 63e90c8

Browse files
authored
Merge pull request #41 from wp-cli/use-http-request
Use `WP_CLI\Utils\http_request()` to fetch `skip-content` build
2 parents 5718f4b + ea53ac6 commit 63e90c8

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

features/core-download.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ Feature: Download WordPress
304304
"""
305305
Success: WordPress downloaded.
306306
"""
307+
And the wp-includes directory should exist
307308
And the wp-content directory should not exist
308309

309310
Scenario: Core download without the wp-content dir should error for non US locale

src/Core_Command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public function download( $args, $assoc_args ) {
156156

157157
$no_content = '';
158158
if ( true === \WP_CLI\Utils\get_flag_value( $assoc_args, 'skip-content' ) ) {
159-
$response = Requests::get( 'https://api.wordpress.org/core/version-check/1.7/', null, array( 'timeout' => 30 ) );
159+
$response = \WP_CLI\Utils\http_request( 'GET', 'https://api.wordpress.org/core/version-check/1.7/' );
160160
if ( 200 === $response->status_code && ( $body = json_decode( $response->body ) ) && is_object( $body ) && isset( $body->offers[0]->packages->no_content ) && is_array( $body->offers ) ) {
161161
$download_url = $body->offers[0]->packages->no_content;
162162
$version = $body->offers[0]->version;

0 commit comments

Comments
 (0)