drupal-console
drupal-console copied to clipboard
[console] ProcessBuilder is removed in Symfony 4, hence Drupal 9
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
- Install a Drupal 9 site.
- Install Drupal Console on it.
- Run
drupal database:client
Solution
Replace the ProcessBuilder
call with Process
.
Example: https://github.com/pact-foundation/pact-php/pull/61
Affected commands:
-
config:edit
-
databsae:client
-
database:query
-
module:install
-
server
Thank you for your contribution. Fixed here https://github.com/hechoendrupal/drupal-console/pull/4335