From 5130ff713bc0c232da280a568962db41bd906bf3 Mon Sep 17 00:00:00 2001 From: John Kary Date: Fri, 2 Oct 2015 21:52:41 -0500 Subject: [PATCH 1/2] Revert "use PHP_OS instead of php_uname('s')" This reverts commit 40e0dc80842985032a1b83b0527e046254cbbfb3. This commit led to a regression on the OS400 platform, where the constant PHP_OS returns "AIX" not "OS400". --- src/Symfony/Component/Console/Output/ConsoleOutput.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Console/Output/ConsoleOutput.php b/src/Symfony/Component/Console/Output/ConsoleOutput.php index d71f062dfb62b..8e6821e5e3733 100644 --- a/src/Symfony/Component/Console/Output/ConsoleOutput.php +++ b/src/Symfony/Component/Console/Output/ConsoleOutput.php @@ -125,7 +125,7 @@ protected function hasStderrSupport() */ private function isRunningOS400() { - return 'OS400' === PHP_OS; + return 'OS400' === php_uname('s'); } /** From e397379e226ff8b5904443371ada644f696864c9 Mon Sep 17 00:00:00 2001 From: John Kary Date: Fri, 2 Oct 2015 21:55:06 -0500 Subject: [PATCH 2/2] [Console] Allow checking for OS400 platform when php_uname() disabled --- src/Symfony/Component/Console/Output/ConsoleOutput.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Console/Output/ConsoleOutput.php b/src/Symfony/Component/Console/Output/ConsoleOutput.php index 8e6821e5e3733..8e1f360141497 100644 --- a/src/Symfony/Component/Console/Output/ConsoleOutput.php +++ b/src/Symfony/Component/Console/Output/ConsoleOutput.php @@ -125,7 +125,13 @@ protected function hasStderrSupport() */ private function isRunningOS400() { - return 'OS400' === php_uname('s'); + $checks = array( + function_exists('php_uname') ? php_uname('s') : '', + getenv('OSTYPE'), + PHP_OS, + ); + + return false !== stristr(implode(';', $checks), 'OS400'); } /**