Skip to content
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

[console] ProcessBuilder is removed in Symfony 4, hence Drupal 9 #4330

Closed
yookoala opened this issue Apr 8, 2022 · 2 comments
Closed

[console] ProcessBuilder is removed in Symfony 4, hence Drupal 9 #4330

yookoala opened this issue Apr 8, 2022 · 2 comments

Comments

@yookoala
Copy link

yookoala commented Apr 8, 2022

Problem/Motivation

Running drupal database:client will run into this error:

Error: Class "Symfony\Component\Process\ProcessBuilder" not found in Drupal\Console\Command\Database\ClientCommand->execute() (line 66 of /home/foobar/public_html/vendor/drupal/console/src/Command/Database/ClientCommand.php).

This is because the ProcessBuilder was deprecated in Symfony 3.4 and was removed in Symfony 4.0. Instead, Process should be used directly.

How to reproduce

  1. Install a Drupal 9 site.
  2. Install Drupal Console on it.
  3. Run drupal database:client

Solution

Replace the ProcessBuilder call with Process.
Example: pact-foundation/pact-php#61

@yookoala
Copy link
Author

yookoala commented Apr 8, 2022

Affected commands:

  • config:edit
  • databsae:client
  • database:query
  • module:install
  • server

LOBsTerr added a commit to LOBsTerr/drupal-console that referenced this issue Sep 15, 2022
LOBsTerr added a commit to LOBsTerr/drupal-console that referenced this issue Sep 15, 2022
LOBsTerr added a commit to LOBsTerr/drupal-console that referenced this issue Sep 15, 2022
LOBsTerr added a commit to LOBsTerr/drupal-console that referenced this issue Sep 15, 2022
LOBsTerr added a commit to LOBsTerr/drupal-console that referenced this issue Sep 15, 2022
LOBsTerr added a commit that referenced this issue Sep 15, 2022
* Add new arguments key and target. Make it possible use not only default target for db connections

* Issue #4330: Replace ProcessBuilder class with Process in module install command.

* Issue #4330: Replace ProcessBuilder class with Process in server command.

* Issue #4330: Replace ProcessBuilder class with Process in edit config command.

* Issue #4330: Replace ProcessBuilder class with Process in db query command.

* Issue #4330: Replace ProcessBuilder class with Process in db client command.
@LOBsTerr
Copy link
Member

Thank you for your contribution. Fixed here #4335

LOBsTerr added a commit that referenced this issue Sep 16, 2022
* Add new arguments key and target. Make it possible use not only default target for db connections

* Issue #4330: Replace ProcessBuilder class with Process in module install command.

* Issue #4330: Replace ProcessBuilder class with Process in server command.

* Issue #4330: Replace ProcessBuilder class with Process in edit config command.

* Issue #4330: Replace ProcessBuilder class with Process in db query command.

* Issue #4330: Replace ProcessBuilder class with Process in db client command.

* Issue #4336: Replace ModuleHandler with ModuleHandlerInterface.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants