From bbf481ad77886b24ebcc6f77ee8c6989172eb657 Mon Sep 17 00:00:00 2001 From: scribu Date: Fri, 12 Jul 2013 01:19:38 +0300 Subject: [PATCH] rename _download() to _read() to make it clearer that it doesn't deal with binary data --- php/commands/core.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/php/commands/core.php b/php/commands/core.php index 59964c08..42419f64 100644 --- a/php/commands/core.php +++ b/php/commands/core.php @@ -46,14 +46,14 @@ class Core_Command extends WP_CLI_Command { WP_CLI::success( 'WordPress downloaded.' ); } - private static function _download( $url ) { + private static function _read( $url ) { exec( 'curl -s ' . escapeshellarg( $url ), $lines, $r ); if ( $r ) exit( $r ); return implode( "\n", $lines ); } private function get_download_offer( $locale ) { - $out = unserialize( self::_download( + $out = unserialize( self::_read( 'https://api.wordpress.org/core/version-check/1.6/?locale=' . $locale ) ); return $out['offers'][0]; @@ -101,7 +101,7 @@ class Core_Command extends WP_CLI_Command { } // TODO: adapt more resilient code from wp-admin/setup-config.php - $assoc_args['keys-and-salts'] = self::_download( + $assoc_args['keys-and-salts'] = self::_read( 'https://api.wordpress.org/secret-key/1.1/salt/' ); $out = Utils\mustache_render( 'wp-config.mustache', $assoc_args ); -- 2.11.0