jhedstrom / DrupalDriver

A collection of drivers for controlling Drupal.
GNU General Public License v2.0
64 stars 95 forks source link

Broaden compatibility with symfony/process #261

Closed jonpugh closed 1 year ago

jonpugh commented 1 year ago

Updates "Fixed compatibility with Symfony\Process v4+ for Drush driver. #251".

I don't know why, I can't explain it. A project has symfony/process 4.4.4, but still, does NOT have the method "fromShellCommandline".

I noticed that another part of symfony/console actually checks for this method to remain compatible, I guess?

Can do this so that the driver works everywhere?

    $process = method_exists(Process::class, 'fromShellCommandline') ? Process::fromShellCommandline($cmd) : new Process($cmd);

https://github.com/symfony/symfony/blob/4.4/src/Symfony/Component/Console/Helper/ProcessHelper.php#L57

jhedstrom commented 1 year ago

Looks good to me, thanks!