bmitch/churn-php

Doesn't work in windows.

bmitch opened this issue · 9 comments

Because of this line:

https://github.com/bmitch/churn-php/blob/master/src/Factories/ProcessFactory.php#L35

Is there another command that will do the same thing that works in Windows and Unix?

Can you perform those operations in PHP?

Quite possibly. Is definitely worth looking into. I'll probably have some time in the coming week to look. But if you are feeling up for it please feel free.

I haven't had time to check into this. If anyone else feels like taking a stab at this please feel free.

It's worth mentioning that the problem in the line comes from the command uniq which doesn't exists in Windows.

But there is another problem which is not related to Windows:

foreach ($this->runningProcesses as $file => $process) {
if ($process->isSuccessful()) {

The script runs forever if a process is terminated but not successful.

Thanks @villfa , are you able to provide an example that makes the script run forever?

You can enter an infinite loop by running churn on a folder containing a space character.

./vendor/bin/churn run my\ project

The command line returns an error because it is built without using escapeshellarg.

To brush the dust off of this and provide value for Windows users, would you be willing to accept a PR that refactors https://github.com/bmitch/churn-php/blob/master/src/Factories/ProcessFactory.php#L34-L36 to a pure PHP implementation?

@josephzidell yes that would be great!

Regarding the escapeshellarg - you can supply parameters one-by-one as array with Symfony process.