From bcd8a73e8c788232359c8d79ded7a7ca10ca3c4d Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Tue, 22 Sep 2020 18:49:53 +0200 Subject: [PATCH] Fix support for running diagnose without openssl The diagnose command already warns when openssl is not available. But the command was failing later when displaying the Openssl version. --- src/Composer/Command/DiagnoseCommand.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Composer/Command/DiagnoseCommand.php b/src/Composer/Command/DiagnoseCommand.php index b7739ff18..94f7eaad1 100644 --- a/src/Composer/Command/DiagnoseCommand.php +++ b/src/Composer/Command/DiagnoseCommand.php @@ -172,7 +172,9 @@ EOT $io->write(sprintf('PHP binary path: %s', PHP_BINARY)); } - $io->write(sprintf('OpenSSL version: %s', OPENSSL_VERSION_TEXT)); + if (defined('OPENSSL_VERSION_TEXT') { + $io->write(sprintf('OpenSSL version: %s', OPENSSL_VERSION_TEXT)); + } return $this->exitCode; }