-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
support $cmd as array in Process #107
Comments
Just a random thought, but if it's faster, why not internally change it to an array and always have that performance gain? |
passing the arg as array has a few more implications. escaping of the command is done at php-src level and no longer in userland. since the command is no longer run in a shell with array-notation it might depend also on the command whether we can apply array-style arg. it might make sense to look into the symfony process component for inspiration |
Hey @staabm, thanks for the input on this, seems like a reasonable change 👍 If this works as well as you described it above, than I agree that this is a great addition to the project. Will have a look at this when time allows it, but until then we're more than happy about contributions for this. If someone has interest in opening a PR, it's important for us is that the pull request should not only focus on the implementation side of things, but also make sure that any new additions are also covered by our test suite (unit tests) to confirm the suggested changes work as expected. Additionally, I don't think this is a bug ticket as nothing is currently broken; I think this is more of a feature suggestion. We recommend opening bug tickets only when you can provide evidence of something being broken, just as a friendly reminder for future tickets :) |
Out of the box you can already pass an array to Process and it will work perfectly, I have been doing this for a few years with no issues other than having to ignore a warning in my IDE, it is only the phpdoc that has the type restricted to string. Happy to make a PR for this including tests. |
I recently started optimizing phpunit process isolation. while doing research I found out, that
proc_open
can start processes with a lot less overhead when using aarray
argument.would be great if we could use
Process
with aarray
argument, so we can start processes with less overhead in e.g. PHPStanThe text was updated successfully, but these errors were encountered: