matteosister / GitElephant

An abstraction layer for git written in PHP
GNU Lesser General Public License v3.0
613 stars 74 forks source link

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

Closed gertvdb closed 4 years ago

gertvdb commented 4 years ago

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.

GenieTim commented 4 years ago

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?

jurgenhaas commented 4 years ago

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.

GenieTim commented 4 years ago

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?

gertvdb commented 4 years ago

The fix seems to work for me. Thanks