Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it possible to run Symfony\Component\Process\Process without default environment variables #50751

Closed
zerkms opened this issue Jun 23, 2023 · 4 comments

Comments

@zerkms
Copy link
Contributor

zerkms commented Jun 23, 2023

Description

At the moment Process unconditionally adds all the environment variables of the current process to the new spawned process:

$env += '\\' === \DIRECTORY_SEPARATOR ? array_diff_ukey($this->getDefaultEnv(), $env, 'strcasecmp') : $this->getDefaultEnv();

It makes it impossible (?) to start a process in a clean environment with strict control of what must or can be in the environment.

Example

$process = new Process(...);
$process->disableDefaultEnv();
$process->run();
@zerkms zerkms changed the title Make it possible to run Symfony\Component\Process\Process without default variables Make it possible to run Symfony\Component\Process\Process without default environment variables Jun 23, 2023
@zerkms
Copy link
Contributor Author

zerkms commented Jun 23, 2023

Okay, I finally found the #24397 which provides a workaround, but wondering if the opinion of the core team has changed after 6 years.

@carsonbot
Copy link

Thank you for this suggestion.
There has not been a lot of activity here for a while. Would you still like to see this feature?

@carsonbot
Copy link

Hello? This issue is about to be closed if nobody replies.

@carsonbot
Copy link

Hey,

I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants