-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Process] Deprecate ProcessBuilder #23111
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
Conversation
nicolas-grekas
commented
Jun 8, 2017
Q | A |
---|---|
Branch? | 3.4 |
Bug fix? | no |
New feature? | no |
BC breaks? | no |
Deprecations? | yes |
Tests pass? | yes |
Fixed tickets | - |
License | MIT |
Doc PR | - |
@@ -11,13 +11,17 @@ | |||
|
|||
namespace Symfony\Component\Process; | |||
|
|||
@trigger_error(sprintf('The %s class is deprecated since version 3.4 and will be removed in 4.0. Use the Process class instead.', __METHOD__), ProcessBuilder::class); |
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.
The arguments at the end needs to be , ProcessBuilder::class), E_USER_DEPRECATED);
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.
thanks, fixed
fc7406a
to
3aa8861
Compare
Thank you @nicolas-grekas. |
This PR was merged into the 3.4 branch. Discussion ---------- [Process] Deprecate ProcessBuilder | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Commits ------- 3aa8861 [Process] Deprecate ProcessBuilder
Please, whenever you deprecate something, add a small comment explaining the main reasons. Thanks! |
The reason here is that the main use case for the ProcessBuilder was to escape the individual parts of the command for you. And this is now supported by the Process class itself by passing an array as the command (where it will escape each element of the array and build the final string command). The ProcessBuilder even relies on this feature now. |
…avier) This PR was squashed before being merged into the 3.1.x-dev branch (closes #564). Discussion ---------- Fix deprecation notice in test (ProcessBuilder) Backward- and forward-compatible fix for ``` Remaining deprecation notices (1) The Symfony\Component\Process\ProcessBuilder class is deprecated since version 3.4 and will be removed in 4.0. Use the Process class instead: 1x 1x in KernelManipulatorTest::testAddToArray from Sensio\Bundle\GeneratorBundle\Tests\Manipulator ``` Relevant commits: - symfony/process@201c3bd (PR symfony/symfony#23111) - symfony/process@e34416d (PR symfony/symfony#21474) - symfony/process@0743280 (PR symfony/symfony#23498) I also considered the simpler test `\Symfony\Component\HttpKernel\Kernel::VERSION_ID >= 30400` but it seems less reliable (version constant _vs_ code, possibly different versions of `symfony/http-kernel` _vs_ `symfony/process`). Commits ------- 5fe7d3e Fix deprecation notice in test (ProcessBuilder)