Skip to content

[Process] Environment variables cannot be autowired #60391

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

Closed
ro0NL opened this issue May 9, 2025 · 1 comment
Closed

[Process] Environment variables cannot be autowired #60391

ro0NL opened this issue May 9, 2025 · 1 comment

Comments

@ro0NL
Copy link
Contributor

ro0NL commented May 9, 2025

Symfony version(s) affected

7.2

Description

Hi,

We noticed when passing envs to Process, they cannot be autowired in the subsequent process, even though the envs are available.

Given

#[Autowire(env: 'SOME')]
private readonly ?string $some = null,

For:

dump('TRACE-autowire: '.$this->some);
dump('TRACE-server:'.($_SERVER['SOME'] ?? null));
dump('TRACE-env:'.($_SERVER['SOME'] ?? null));
dump('TRACE-getenv:'.getenv('SOME'));

We see:

"TRACE-autowire: "
"TRACE-server:some-value"
"TRACE-env:some-value"
"TRACE-getenv:some-value"

How to reproduce

We feed Process envs thru RunProcessMessage

Possible Solution

No response

Additional Context

No response

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

2 participants