Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,14 @@ function upload_results( $results, $rev, $message, $env, $api_key ) {
* Get the environmental details
*/
function get_env_details() {
$WPT_DB_HOST = getenv( 'WPT_DB_HOST' ) ? : 'localhost';
$WPT_DB_USER = getenv( 'WPT_DB_USER' );
$WPT_DB_PASSWORD = getenv( 'WPT_DB_PASSWORD' );
$WPT_DB_NAME = getenv( 'WPT_DB_NAME' );
$env = array(
'php_version' => phpversion(),
'php_modules' => array(),
'system_utils' => array(),
'mysql_version' => trim( shell_exec( 'mysql --version' ) ),
'os_name' => trim( shell_exec( 'uname -s' ) ),
'os_version' => trim( shell_exec( 'uname -r' ) ),
);
Expand Down Expand Up @@ -235,6 +238,10 @@ function get_env_details() {
$curl_bits = explode( PHP_EOL, str_replace( 'curl ', '', shell_exec( 'curl --version' ) ) );
$curl = array_shift( $curl_bits );
$env['system_utils']['curl'] = trim( $curl );
$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();

if ( class_exists( 'Imagick' ) ) {
$imagick = new Imagick();
$version = $imagick->getVersion();
Expand Down
5 changes: 4 additions & 1 deletion prepare.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@
'php_version' => phpversion(),
'php_modules' => array(),
'system_utils' => array(),
'mysql_version' => trim( shell_exec( 'mysql --version' ) ),
'os_name' => trim( shell_exec( 'uname -s' ) ),
'os_version' => trim( shell_exec( 'uname -r' ) ),
);
Expand Down Expand Up @@ -219,6 +218,10 @@
\$env['system_utils']['graphicsmagick'] = \$version[1];
}
\$env['system_utils']['openssl'] = str_replace( 'OpenSSL ', '', trim( shell_exec( 'openssl version' ) ) );

\$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
\$env['mysql_version'] = \$mysqli->query("SELECT VERSION()")->fetch_row()[0];
\$mysqli->close();
file_put_contents( __DIR__ . '/tests/phpunit/build/logs/env.json', json_encode( \$env, JSON_PRETTY_PRINT ) );
if ( 'cli' === php_sapi_name() && defined( 'WP_INSTALLING' ) && WP_INSTALLING ) {
echo PHP_EOL;
Expand Down