drupal-console icon indicating copy to clipboard operation
drupal-console copied to clipboard

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

Open yookoala opened this issue 2 years ago • 1 comments

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: https://github.com/pact-foundation/pact-php/pull/61

yookoala avatar Apr 08 '22 07:04 yookoala

Affected commands:

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

yookoala avatar Apr 08 '22 08:04 yookoala

Thank you for your contribution. Fixed here https://github.com/hechoendrupal/drupal-console/pull/4335

LOBsTerr avatar Sep 15 '22 12:09 LOBsTerr