Skip to content

Commit 90933b3

Browse files
sentissonicolas-grekas
authored andcommitted
[Console] work around disabled putenv()
1 parent 37746b2 commit 90933b3

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Application.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,10 @@ public function setCommandLoader(CommandLoaderInterface $commandLoader)
114114
*/
115115
public function run(InputInterface $input = null, OutputInterface $output = null)
116116
{
117-
putenv('LINES='.$this->terminal->getHeight());
118-
putenv('COLUMNS='.$this->terminal->getWidth());
117+
if (\function_exists('putenv')) {
118+
@putenv('LINES='.$this->terminal->getHeight());
119+
@putenv('COLUMNS='.$this->terminal->getWidth());
120+
}
119121

120122
if (null === $input) {
121123
$input = new ArgvInput();
@@ -980,7 +982,9 @@ protected function configureIO(InputInterface $input, OutputInterface $output)
980982
$input->setInteractive(false);
981983
}
982984

983-
putenv('SHELL_VERBOSITY='.$shellVerbosity);
985+
if (\function_exists('putenv')) {
986+
@putenv('SHELL_VERBOSITY='.$shellVerbosity);
987+
}
984988
$_ENV['SHELL_VERBOSITY'] = $shellVerbosity;
985989
$_SERVER['SHELL_VERBOSITY'] = $shellVerbosity;
986990
}

0 commit comments

Comments
 (0)