@@ -73,14 +73,14 @@ static protected function tarball_url($url, $auth = NULL) {
7373 if ($ auth )
7474 $ auth = "-u $ {auth}" ;
7575 // TODO pure PHP
76- return trim (shell_exec ("curl -sSfL $ {auth} $ {url} | jq -r '.tarball_url' " ));
76+ return trim (shell_exec ("curl -sfL $ {auth} $ {url} | jq -r '.tarball_url' " ));
7777 }
7878
7979 static protected function fetch_tarball ($ url , $ auth = NULL ) {
8080 if ($ auth )
8181 $ auth = "-u $ {auth}" ;
8282 // TODO pure PHP
83- return shell_exec ("echo -n $(readlink -n -f .)/; curl -sSfLJO -w '%{filename_effective}' $ {auth} $ {url}" );
83+ return shell_exec ("echo -n $(readlink -n -f .)/; curl -sfLJO -w '%{filename_effective}' $ {auth} $ {url}" );
8484 }
8585
8686 static protected function fetch_tarball_via_oauth ($ key , $ secret , $ uri ) {
@@ -134,34 +134,34 @@ static protected abstract function tgz($args, $assoc_args);
134134 static protected function apply ($ cmd , $ args , $ assoc_args ) {
135135 $ op = array_shift ($ args );
136136 list ($ url , $ tgz , $ zip ) = static ::tgz ($ args , $ assoc_args );
137- WP_CLI ::log ("Installing from $ zip " );
137+ WP_CLI ::debug ("Installing from $ zip " );
138138 WP_CLI ::run_command (array ($ cmd , $ op , $ zip ), array ('force ' => 1 ));
139- WP_CLI ::log ("Removing $ tgz, $ zip " );
139+ WP_CLI ::debug ("Removing $ tgz, $ zip " );
140140 unlink ($ tgz );
141141 unlink ($ zip );
142142 }
143143}
144144
145145if (!function_exists ('http_parse_headers ' )) {
146- function http_parse_headers ($ header ) {
147- $ retVal = array ();
148- $ fields = explode ("\r\n" , preg_replace ('/\x0D\x0A[\x09\x20]+/ ' , ' ' , $ header ));
146+ function http_parse_headers ($ headers_raw ) {
147+ $ headers = array ();
148+ $ fields = explode ("\r\n" , preg_replace ('/\x0D\x0A[\x09\x20]+/ ' , ' ' , $ headers_raw ));
149149 foreach ( $ fields as $ field ) {
150150 if ( preg_match ('/([^:]+): (.+)/m ' , $ field , $ match ) ) {
151151 $ match [1 ] = preg_replace_callback ('/(?<=^|[\x09\x20\x2D])./ ' , function ($ x ) { return strtoupper ($ x [0 ]); }, strtolower (trim ($ match [1 ])));
152- if ( isset ($ retVal [$ match [1 ]]) ) {
153- if ( is_array ( $ retVal [$ match [1 ]] ) ) {
154- $ i = count ($ retVal [$ match [1 ]]);
155- $ retVal [$ match [1 ]][$ i ] = $ match [2 ];
152+ if ( isset ($ headers [$ match [1 ]]) ) {
153+ if ( is_array ( $ headers [$ match [1 ]] ) ) {
154+ $ i = count ($ headers [$ match [1 ]]);
155+ $ headers [$ match [1 ]][$ i ] = $ match [2 ];
156156 }
157157 else {
158- $ retVal [$ match [1 ]] = array ($ retVal [$ match [1 ]], $ match [2 ]);
158+ $ headers [$ match [1 ]] = array ($ headers [$ match [1 ]], $ match [2 ]);
159159 }
160160 } else {
161- $ retVal [$ match [1 ]] = trim ($ match [2 ]);
161+ $ headers [$ match [1 ]] = trim ($ match [2 ]);
162162 }
163163 }
164164 }
165- return $ retVal ;
165+ return $ headers ;
166166 }
167167}
0 commit comments