[Console] work around disabled putenv()

This commit is contained in:
SenTisso 2020-09-12 17:15:36 +02:00 committed by Nicolas Grekas
parent 61c1175d05
commit d3f909bff3

View File

@ -114,8 +114,10 @@ class Application implements ResetInterface
*/
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();
@ -980,7 +982,9 @@ class Application implements ResetInterface
$input->setInteractive(false);
}
putenv('SHELL_VERBOSITY='.$shellVerbosity);
if (\function_exists('putenv')) {
@putenv('SHELL_VERBOSITY='.$shellVerbosity);
}
$_ENV['SHELL_VERBOSITY'] = $shellVerbosity;
$_SERVER['SHELL_VERBOSITY'] = $shellVerbosity;
}