Skip to content

Commit

Permalink
Merge pull request #177 from grooverdan/curl
Browse files Browse the repository at this point in the history
Use curl information from library rather than curl --version
  • Loading branch information
javiercasares authored Feb 7, 2024
2 parents ccfa589 + 1d7ea51 commit 113942d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,9 @@ function get_env_details() {
foreach( $php_modules as $php_module ) {
$env['php_modules'][ $php_module ] = phpversion( $php_module );
}
$curl_bits = explode( PHP_EOL, str_replace( 'curl ', '', shell_exec( 'curl --version' ) ) );
$curl = array_shift( $curl_bits );
$env['system_utils']['curl'] = trim( $curl );
function curl_selected_bits($k) { return in_array($k, array('version', 'ssl_version', 'libz_version')); }
$curl_bits = curl_version();
$env['system_utils']['curl'] = implode(' ',array_values(array_filter($curl_bits, 'curl_selected_bits',ARRAY_FILTER_USE_KEY) ));
$mysqli = new mysqli($WPT_DB_HOST, $WPT_DB_USER, $WPT_DB_PASSWORD, $WPT_DB_NAME);
$env['mysql_version'] = $mysqli->query("SELECT VERSION()")->fetch_row()[0];
$mysqli->close();
Expand Down
6 changes: 3 additions & 3 deletions prepare.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@
foreach( \$php_modules as \$php_module ) {
\$env['php_modules'][ \$php_module ] = phpversion( \$php_module );
}
\$curl_bits = explode( PHP_EOL, str_replace( 'curl ', '', shell_exec( 'curl --version' ) ) );
\$curl = array_shift( \$curl_bits );
\$env['system_utils']['curl'] = trim( \$curl );
function curl_selected_bits(\$k) { return in_array(\$k, array('version', 'ssl_version', 'libz_version')); }
\$curl_bits = curl_version();
\$env['system_utils']['curl'] = implode(' ',array_values(array_filter(\$curl_bits, 'curl_selected_bits',ARRAY_FILTER_USE_KEY) ));
if ( class_exists( 'Imagick' ) ) {
\$imagick = new Imagick();
\$version = \$imagick->getVersion();
Expand Down

0 comments on commit 113942d

Please sign in to comment.