jderusse / composer-warmup

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with composer v2.3

alexpozzi opened this issue · comments

Hello,
I'm trying to use this package in combination with composer v2.3 and I get the following error when launching the warmup-opcode command.

In PhpServerCompiler.php line 33:
                                                              
  [Error]                                                     
  Class "Symfony\Component\Process\ProcessBuilder" not found  
                                                              

Exception trace:
  at /home/docker/composer/vendor/jderusse/composer-warmup/src/Compiler/PhpServerCompiler.php:33
 Jderusse\Warmup\Compiler\PhpServerCompiler->startServer() at /home/docker/composer/vendor/jderusse/composer-warmup/src/Compiler/PhpServerCompiler.php:23
 Jderusse\Warmup\Compiler\PhpServerCompiler->__construct() at /home/docker/composer/vendor/jderusse/composer-warmup/src/Console/WarmupCommand.php:67
 Jderusse\Warmup\Console\WarmupCommand->execute() at phar:///usr/bin/composer/vendor/symfony/console/Command/Command.php:298
 Symfony\Component\Console\Command\Command->run() at phar:///usr/bin/composer/vendor/symfony/console/Application.php:1015
 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/bin/composer/vendor/symfony/console/Application.php:299
 Symfony\Component\Console\Application->doRun() at phar:///usr/bin/composer/src/Composer/Console/Application.php:334
 Composer\Console\Application->doRun() at phar:///usr/bin/composer/vendor/symfony/console/Application.php:171
 Symfony\Component\Console\Application->run() at phar:///usr/bin/composer/src/Composer/Console/Application.php:130
 Composer\Console\Application->run() at phar:///usr/bin/composer/bin/composer:83
 require() at /usr/bin/composer:29

warmup-opcode [<extra>...]

It seems to be related to the fact that composer v2.3 requires symfony/process version of at least v5.4.0 which does not include anymore the Symfony\Component\Process\ProcessBuilder class.

If it's fine with you I can create a PR to refactor the pieces of code that are using the process builder and try to support both symfony/process <4.0 and >=4.0.