Skip to content

Commit

Permalink
[Console] work around disabled putenv()
Browse files Browse the repository at this point in the history
  • Loading branch information
sentisso authored and nicolas-grekas committed Sep 15, 2020
1 parent 37746b2 commit 90933b3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Application.php
Expand Up @@ -114,8 +114,10 @@ public function setCommandLoader(CommandLoaderInterface $commandLoader)
*/
public function run(InputInterface $input = null, OutputInterface $output = null)
{
putenv('LINES='.$this->terminal->getHeight());
putenv('COLUMNS='.$this->terminal->getWidth());
if (\function_exists('putenv')) {
@putenv('LINES='.$this->terminal->getHeight());
@putenv('COLUMNS='.$this->terminal->getWidth());
}

if (null === $input) {
$input = new ArgvInput();
Expand Down Expand Up @@ -980,7 +982,9 @@ protected function configureIO(InputInterface $input, OutputInterface $output)
$input->setInteractive(false);
}

putenv('SHELL_VERBOSITY='.$shellVerbosity);
if (\function_exists('putenv')) {
@putenv('SHELL_VERBOSITY='.$shellVerbosity);
}
$_ENV['SHELL_VERBOSITY'] = $shellVerbosity;
$_SERVER['SHELL_VERBOSITY'] = $shellVerbosity;
}
Expand Down

0 comments on commit 90933b3

Please sign in to comment.