Skip to content

[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

Merged
merged 1 commit into from
Jun 9, 2017

Conversation

nicolas-grekas
Copy link
Member

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);
Copy link
Contributor

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);

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, fixed

@fabpot
Copy link
Member

fabpot commented Jun 9, 2017

Thank you @nicolas-grekas.

@fabpot fabpot merged commit 3aa8861 into symfony:3.4 Jun 9, 2017
fabpot added a commit that referenced this pull request Jun 9, 2017
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
@javiereguiluz
Copy link
Member

Please, whenever you deprecate something, add a small comment explaining the main reasons. Thanks!

@stof
Copy link
Member

stof commented Jun 9, 2017

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.

@nicolas-grekas nicolas-grekas deleted the proc-builder-deprec branch July 10, 2017 15:58
fabpot added a commit to sensiolabs/SensioGeneratorBundle that referenced this pull request Jul 17, 2017
…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)
This was referenced Oct 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants