Skip to content

Commit

Permalink
Merge pull request #174 from wp-cli/fix/adapt-to-requests-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
schlessera authored May 12, 2023
2 parents a1345d2 + ab2d33f commit 7b01ba9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"require": {
"ext-json": "*",
"composer/composer": "^1.10.23 || ~2.2.17",
"wp-cli/wp-cli": "^2.5"
"wp-cli/wp-cli": "dev-main as 2.8.x-dev"
},
"require-dev": {
"wp-cli/scaffold-command": "^1 || ^2",
Expand Down
6 changes: 3 additions & 3 deletions src/Package_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use WP_CLI\Utils;
use WP_CLI\JsonManipulator;
use WP_CLI\PackageManagerEventSubscriber;
use WP_CLI\RequestsLibrary;

/**
* Lists, installs, and removes WP-CLI packages.
Expand Down Expand Up @@ -78,7 +79,6 @@
class Package_Command extends WP_CLI_Command {

const PACKAGE_INDEX_URL = 'https://wp-cli.org/package-index/';
const SSL_CERTIFICATE = '/rmccue/requests/library/Requests/Transport/cacert.pem';

const DEFAULT_DEV_BRANCH_CONSTRAINTS = 'dev-main || dev-master || dev-trunk';

Expand Down Expand Up @@ -1316,8 +1316,8 @@ private function set_composer_auth_env_var() {
*/
private function avoid_composer_ca_bundle() {
if ( Utils\inside_phar() && ! getenv( 'SSL_CERT_FILE' ) && ! getenv( 'SSL_CERT_DIR' ) && ! ini_get( 'openssl.cafile' ) && ! ini_get( 'openssl.capath' ) ) {
$certificate = Utils\extract_from_phar( WP_CLI_VENDOR_DIR . self::SSL_CERTIFICATE );
putenv( "SSL_CERT_FILE={$certificate}" );
$certificate_path = Utils\extract_from_phar( RequestsLibrary::get_bundled_certificate_path() );
putenv( "SSL_CERT_FILE={$certificate_path}" );
}
}

Expand Down

0 comments on commit 7b01ba9

Please sign in to comment.