matteosister / GitElephant

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

Make LC_ALL call optional on Windows #142

Closed tobias-kuendig closed 6 years ago

tobias-kuendig commented 6 years ago

We have the ability to supply a custom GitBinary which is great!

Unfortunately, this line is causing problems on Windows systems, since Windows cannot process the LC_ALL definition. Currently all commands fail because of this.

Would you be willing to accept a PR where this call is wrapped to be excluded on Windows?

if (stripos(PHP_OS, 'WIN') !== 0) {
    // We rely on the C locale in all output we parse.
    $cmd = 'LC_ALL=C ' . $cmd;
}
GenieTim commented 6 years ago

This line was introduced with #121. I am honestly not sure if this line is really a fix or rather symptom-fighting of another issue or mal-configuration. However, yes, we will accept the PR. I will keep in mind, that when I encounter a better way to fix these issues with locales, I will get rid of these lines...

tobias-kuendig commented 6 years ago

Great, thank you!

See #143