From: scribu Date: Thu, 7 Nov 2013 16:10:51 +0000 (+0200) Subject: make cacert.pem file available from Phar; closes #859 X-Git-Tag: v0.13.0~40 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=24e296d1af078297c86a6eef49cd5bc0381ce2f2;p=wvm%2Fwvm.git make cacert.pem file available from Phar; closes #859 --- diff --git a/php/commands/core.php b/php/commands/core.php index 2a11de3a..e0f2d787 100644 --- a/php/commands/core.php +++ b/php/commands/core.php @@ -13,7 +13,7 @@ class Core_Command extends WP_CLI_Command { * Download core WordPress files. * * ## OPTIONS - * + * * [--path=] * : Specify the path in which to install WordPress. * @@ -125,6 +125,16 @@ class Core_Command extends WP_CLI_Command { } private static function _request( $method, $url, $headers = array(), $options = array() ) { + // cURL can't read Phar archives + if ( 0 === strpos( WP_CLI_ROOT, 'phar://' ) ) { + $options['verify'] = sys_get_temp_dir() . '/wp-cli-cacert.pem'; + + copy( + WP_CLI_ROOT . '/vendor/rmccue/requests/library/Requests/Transport/cacert.pem', + $options['verify'] + ); + } + try { return Requests::get( $url, $headers, $options ); } catch( Requests_Exception $ex ) { diff --git a/utils/make-phar.php b/utils/make-phar.php index 0a7b16d8..4563f60a 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -62,6 +62,7 @@ foreach ( $finder as $file ) { } add_file( $phar, './vendor/autoload.php' ); +add_file( $phar, './vendor/rmccue/requests/library/Requests/Transport/cacert.pem' ); $phar->setStub( <<