Check if method inheritEnvironmentVariables exists
This commit is contained in:
parent
1f4625053c
commit
bd72a56505
@ -401,7 +401,7 @@ final class Dotenv
|
|||||||
|
|
||||||
$process = method_exists(Process::class, 'fromShellCommandline') ? Process::fromShellCommandline('echo '.$matches[0]) : new Process('echo '.$matches[0]);
|
$process = method_exists(Process::class, 'fromShellCommandline') ? Process::fromShellCommandline('echo '.$matches[0]) : new Process('echo '.$matches[0]);
|
||||||
|
|
||||||
if (!method_exists(Process::class, 'fromShellCommandline')) {
|
if (!method_exists(Process::class, 'fromShellCommandline') && method_exists(Process::class, 'inheritEnvironmentVariables')) {
|
||||||
// Symfony 3.4 does not inherit env vars by default:
|
// Symfony 3.4 does not inherit env vars by default:
|
||||||
$process->inheritEnvironmentVariables();
|
$process->inheritEnvironmentVariables();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user