-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
Fix / Forward native ENV variables to child process #129
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this
As it's done in the startProcess
method tho (i.e. applies to every child process started this way), I'm still a little concerned that we'll essentially be "leaking" environment variables to whatever process the developer runs.
Whilst I think they're generally well-named environment variables, there's a risk that they may be used incorrectly or even abused... so I'm inclined to suggest that we don't do this by default for everything and instead have either an explicit method for this or an opt-in flag
I agree about env variable that should be passed only to php/artisan processes. I also think it's important we send the ini configuration to php processes. That's why I suggested a php endpoint in the first place. |
Co-authored-by: Simon Hamp <[email protected]>
Okay! I'll convert this to draft. I was hacking on this before seeing the conclusion of the other PR 😅 Like a real life race condition To verify I fully comprehend what we're trying to achieve let me recap.
On the Laravel side:
Do I have the right idea? I'm wondering if we need two endpoints in that case or just the one? |
Also @SRWieZ if you like to pick up any of this feel free. Didn't mean to swoop in. Only if you want to of course, no pressure 🤝 |
Sounds like it to me |
No worries! 😌 Already gave my input. You can take it from there. I will be less available for 2 days so fill free to finish this. |
This PR applies the fix as suggested in NativePHP/laravel#402 on the electron plugin side.
This way we don't need to forward any variables from the process facade. This also is more in line with how internal processes are handled (like the queue & the php server)
Mind that the native env variables are forwarded to every child process. Not exclusively to artisan commands. This was touched on in PR NativePHP/laravel#402. We could do a separate endpoint for artisan commands, though I'm doubting now we know it concerns a small amount of extra variables. There is no harm (I can think of) in passing them along.