[11.x] Use command string instead of array on Concurrency\ProcessDriver
#52813
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a follow-up to PR #52807
This PR:
Builds a command string to call the
invoke-serialized-closure
artisan command, instead of using an array of commands partsChanges the
phpBinary
andartisanBinary
methods to use the same implementation asIlluminate\Console\Application
, which already includes escaping of these binary pathsframework/src/Illuminate/Console/Application.php
Lines 85 to 88 in 79fbf4a
framework/src/Illuminate/Console/Application.php
Lines 95 to 98 in 79fbf4a
Notes
The issue with using the command as an array, is that Symfony's Process Component will quote each part when escaping the command, thus not allowing to send a process to the background by using
2>&1 &
Previous PR fixed issue #52790, but kept the calling process alive, as noted in comment #52807 (comment)
This approach allows the command to be truly sent in the background without holding up an FPM worker until the deferred commands are executed
Post Script
I noted the
Concurrency
component'scomposer.json
file is missingilluminate/support
in itsrequire
section. Also, the namespace on the PSR-4 autoload section is wrong.framework/src/Illuminate/Concurrency/composer.json
Lines 16 to 25 in 79fbf4a
Instead of modifying it in this PR, or sending it as a new PR, I made comments to PR #52801 which is refactoring some related classes.