Issue #3117858 by longwave, druprad, Kristen Pol: [Symfony 5] The "Symfony\Component\Process\Process::inheritEnvironmentVariables()" method is deprecated since Symfony 4.4, env variables are always inherited
parent
f7e6636652
commit
50332db194
|
@ -24,7 +24,6 @@ trait ExecTrait {
|
||||||
*/
|
*/
|
||||||
protected function mustExec($cmd, $cwd, array $env = []) {
|
protected function mustExec($cmd, $cwd, array $env = []) {
|
||||||
$process = new Process($cmd, $cwd, $env + ['PATH' => getenv('PATH'), 'HOME' => getenv('HOME')]);
|
$process = new Process($cmd, $cwd, $env + ['PATH' => getenv('PATH'), 'HOME' => getenv('HOME')]);
|
||||||
$process->inheritEnvironmentVariables();
|
|
||||||
$process->setTimeout(300)->setIdleTimeout(300)->run();
|
$process->setTimeout(300)->setIdleTimeout(300)->run();
|
||||||
$exitCode = $process->getExitCode();
|
$exitCode = $process->getExitCode();
|
||||||
if (0 != $exitCode) {
|
if (0 != $exitCode) {
|
||||||
|
|
|
@ -105,7 +105,6 @@ class QuickStartTest extends TestCase {
|
||||||
'--suppress-login',
|
'--suppress-login',
|
||||||
];
|
];
|
||||||
$process = new Process($install_command, NULL, ['DRUPAL_DEV_SITE_PATH' => $this->testDb->getTestSitePath()]);
|
$process = new Process($install_command, NULL, ['DRUPAL_DEV_SITE_PATH' => $this->testDb->getTestSitePath()]);
|
||||||
$process->inheritEnvironmentVariables();
|
|
||||||
$process->setTimeout(500);
|
$process->setTimeout(500);
|
||||||
$process->start();
|
$process->start();
|
||||||
$guzzle = new Client();
|
$guzzle = new Client();
|
||||||
|
@ -158,7 +157,6 @@ class QuickStartTest extends TestCase {
|
||||||
'--suppress-login',
|
'--suppress-login',
|
||||||
];
|
];
|
||||||
$process = new Process($install_command, NULL, ['DRUPAL_DEV_SITE_PATH' => $this->testDb->getTestSitePath()]);
|
$process = new Process($install_command, NULL, ['DRUPAL_DEV_SITE_PATH' => $this->testDb->getTestSitePath()]);
|
||||||
$process->inheritEnvironmentVariables();
|
|
||||||
$process->setTimeout(500);
|
$process->setTimeout(500);
|
||||||
$process->start();
|
$process->start();
|
||||||
while ($process->isRunning()) {
|
while ($process->isRunning()) {
|
||||||
|
@ -195,7 +193,6 @@ class QuickStartTest extends TestCase {
|
||||||
"--site-name='Test site {$this->testDb->getDatabasePrefix()}'",
|
"--site-name='Test site {$this->testDb->getDatabasePrefix()}'",
|
||||||
];
|
];
|
||||||
$install_process = new Process($install_command, NULL, ['DRUPAL_DEV_SITE_PATH' => $this->testDb->getTestSitePath()]);
|
$install_process = new Process($install_command, NULL, ['DRUPAL_DEV_SITE_PATH' => $this->testDb->getTestSitePath()]);
|
||||||
$install_process->inheritEnvironmentVariables();
|
|
||||||
$install_process->setTimeout(500);
|
$install_process->setTimeout(500);
|
||||||
$result = $install_process->run();
|
$result = $install_process->run();
|
||||||
// The progress bar uses STDERR to write messages.
|
// The progress bar uses STDERR to write messages.
|
||||||
|
@ -210,7 +207,6 @@ class QuickStartTest extends TestCase {
|
||||||
'--suppress-login',
|
'--suppress-login',
|
||||||
];
|
];
|
||||||
$server_process = new Process($server_command, NULL, ['DRUPAL_DEV_SITE_PATH' => $this->testDb->getTestSitePath()]);
|
$server_process = new Process($server_command, NULL, ['DRUPAL_DEV_SITE_PATH' => $this->testDb->getTestSitePath()]);
|
||||||
$server_process->inheritEnvironmentVariables();
|
|
||||||
$server_process->start();
|
$server_process->start();
|
||||||
$guzzle = new Client();
|
$guzzle = new Client();
|
||||||
$port = FALSE;
|
$port = FALSE;
|
||||||
|
@ -249,7 +245,6 @@ class QuickStartTest extends TestCase {
|
||||||
"--site-name='Test another site {$this->testDb->getDatabasePrefix()}'",
|
"--site-name='Test another site {$this->testDb->getDatabasePrefix()}'",
|
||||||
];
|
];
|
||||||
$install_process = new Process($install_command, NULL, ['DRUPAL_DEV_SITE_PATH' => $this->testDb->getTestSitePath()]);
|
$install_process = new Process($install_command, NULL, ['DRUPAL_DEV_SITE_PATH' => $this->testDb->getTestSitePath()]);
|
||||||
$install_process->inheritEnvironmentVariables();
|
|
||||||
$install_process->setTimeout(500);
|
$install_process->setTimeout(500);
|
||||||
$result = $install_process->run();
|
$result = $install_process->run();
|
||||||
$this->assertStringContainsString('Drupal is already installed.', $install_process->getOutput());
|
$this->assertStringContainsString('Drupal is already installed.', $install_process->getOutput());
|
||||||
|
@ -278,7 +273,6 @@ class QuickStartTest extends TestCase {
|
||||||
"--site-name='Test site {$this->testDb->getDatabasePrefix()}' --suppress-login",
|
"--site-name='Test site {$this->testDb->getDatabasePrefix()}' --suppress-login",
|
||||||
];
|
];
|
||||||
$process = new Process($install_command, NULL, ['DRUPAL_DEV_SITE_PATH' => $this->testDb->getTestSitePath()]);
|
$process = new Process($install_command, NULL, ['DRUPAL_DEV_SITE_PATH' => $this->testDb->getTestSitePath()]);
|
||||||
$process->inheritEnvironmentVariables();
|
|
||||||
$process->run();
|
$process->run();
|
||||||
$this->assertStringContainsString('\'umami\' is not a valid install profile. Did you mean \'demo_umami\'?', $process->getErrorOutput());
|
$this->assertStringContainsString('\'umami\' is not a valid install profile. Did you mean \'demo_umami\'?', $process->getErrorOutput());
|
||||||
}
|
}
|
||||||
|
@ -294,7 +288,6 @@ class QuickStartTest extends TestCase {
|
||||||
'--suppress-login',
|
'--suppress-login',
|
||||||
];
|
];
|
||||||
$server_process = new Process($server_command, NULL, ['DRUPAL_DEV_SITE_PATH' => $this->testDb->getTestSitePath()]);
|
$server_process = new Process($server_command, NULL, ['DRUPAL_DEV_SITE_PATH' => $this->testDb->getTestSitePath()]);
|
||||||
$server_process->inheritEnvironmentVariables();
|
|
||||||
$server_process->run();
|
$server_process->run();
|
||||||
$this->assertStringContainsString('No installation found. Use the \'install\' command.', $server_process->getErrorOutput());
|
$this->assertStringContainsString('No installation found. Use the \'install\' command.', $server_process->getErrorOutput());
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,7 +160,6 @@ trait DeprecationListenerTrait {
|
||||||
'The "Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher::dispatch()" method will require a new "string|null $eventName" argument in the next major version of its parent class "Symfony\Contracts\EventDispatcher\EventDispatcherInterface", not defining it is deprecated.',
|
'The "Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher::dispatch()" method will require a new "string|null $eventName" argument in the next major version of its parent class "Symfony\Contracts\EventDispatcher\EventDispatcherInterface", not defining it is deprecated.',
|
||||||
'Passing a command as string when creating a "Symfony\Component\Process\Process" instance is deprecated since Symfony 4.2, pass it as an array of its arguments instead, or use the "Process::fromShellCommandline()" constructor if you need features provided by the shell.',
|
'Passing a command as string when creating a "Symfony\Component\Process\Process" instance is deprecated since Symfony 4.2, pass it as an array of its arguments instead, or use the "Process::fromShellCommandline()" constructor if you need features provided by the shell.',
|
||||||
'Passing arguments to "Symfony\Component\HttpFoundation\Request::isMethodSafe()" has been deprecated since Symfony 4.4; use "Symfony\Component\HttpFoundation\Request::isMethodCacheable()" to check if the method is cacheable instead.',
|
'Passing arguments to "Symfony\Component\HttpFoundation\Request::isMethodSafe()" has been deprecated since Symfony 4.4; use "Symfony\Component\HttpFoundation\Request::isMethodCacheable()" to check if the method is cacheable instead.',
|
||||||
'The "Symfony\Component\Process\Process::inheritEnvironmentVariables()" method is deprecated since Symfony 4.4, env variables are always inherited.',
|
|
||||||
'The "Symfony\Component\Debug\BufferingLogger" class is deprecated since Symfony 4.4, use "Symfony\Component\ErrorHandler\BufferingLogger" instead.',
|
'The "Symfony\Component\Debug\BufferingLogger" class is deprecated since Symfony 4.4, use "Symfony\Component\ErrorHandler\BufferingLogger" instead.',
|
||||||
// The following deprecation is listed for Twig 2 compatibility when unit
|
// The following deprecation is listed for Twig 2 compatibility when unit
|
||||||
// testing using \Symfony\Component\ErrorHandler\DebugClassLoader.
|
// testing using \Symfony\Component\ErrorHandler\DebugClassLoader.
|
||||||
|
|
Loading…
Reference in New Issue