matteosister / GitElephant

An abstraction layer for git written in PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Process::fromShellCommandline($cmd, $cwd); fails

gertvdb opened this issue · comments

The function Process::fromShellCommandline($cmd, $cwd); doesn't work in latest release (v4.1.0)

Screenshot 2020-03-19 at 20 30 45

I'm running this via a composer script. Changing it to $process = new Process($cmd, $cwd); seem to work.

Can you tell me the version of the Symfony Process component you have installed?
This function was setup in GitElephant v4.1.0, and potentially equals an unnoticed incompatibility between Symfony Process versions.
Does it work if you force composer to install GitElephant < v4.1.0?

I'm seeing the same thing and here I'm using symfony/process version 3.4.38 - this is within a Drupal 8 context, hence the symfony 3.x dependency.

I see. After minor research, I found out: Since v3.3, Process can be instantiated with an array. The string method we used – and I mistakenly removed – is deprecated since Symfony 4.2 – relocated to be used via Process::fromShellCommandline – and removed in 5.0. Ergo, either we exclude newer or elder Process versions or introduce a case distinction – that latter is my recommendation (for the moment at least, potentially untill a new major version of GitElephant) and implementation in #165. May I ask someone of you to test whether the fix works for you?

The fix seems to work for me. Thanks