From beacdf4e51b1e962acbda93aef931e5e81844ef3 Mon Sep 17 00:00:00 2001 From: johnstevenson Date: Fri, 20 Dec 2019 18:59:49 +0000 Subject: [PATCH] Add Windows OneDrive to platform warnings --- src/Composer/Command/DiagnoseCommand.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Composer/Command/DiagnoseCommand.php b/src/Composer/Command/DiagnoseCommand.php index 19ed81392..9bc271fa1 100644 --- a/src/Composer/Command/DiagnoseCommand.php +++ b/src/Composer/Command/DiagnoseCommand.php @@ -576,6 +576,13 @@ EOT $warnings['xdebug_loaded'] = true; } + if (defined('PHP_WINDOWS_VERSION_BUILD') + && (version_compare(PHP_VERSION, '7.2.23', '<') + || (version_compare(PHP_VERSION, '7.3.0', '>=') + && version_compare(PHP_VERSION, '7.3.10', '<')))) { + $warnings['onedrive'] = PHP_VERSION; + } + if (!empty($errors)) { foreach ($errors as $error => $current) { switch ($error) { @@ -699,6 +706,11 @@ EOT $text .= " xdebug.profiler_enabled = 0"; $displayIniMessage = true; break; + + case 'onedrive': + $text = "The Windows OneDrive folder is not supported on PHP versions below 7.2.23 and 7.3.10.".PHP_EOL; + $text .= "Upgrade your PHP ({$current}) to use this location with Composer.".PHP_EOL; + break; } $out($text, 'comment'); }