cocur / background-process

Start processes in the background that continue running when the PHP process exists.
MIT License
295 stars 61 forks source link

Fix for calling Exception from within a namespace #8

Closed Samyoul closed 9 years ago

Samyoul commented 9 years ago

Calling the Exception class from within a namespace has php assuming Exception is a class belonging to the namespace, can be fixed by prepending the class name with "\".

Samyoul commented 9 years ago

This class assumes that the command line will be ran on a Linux based server, and fails when ran on a Windows based server.

Added:

Method serverOS(): Returns integer, 1 if Windows, 2 if Linux, 3 if other Field $serverOS: int

On instantiation OS is determined and stored in the object field serverOS. The field is used as a logic check when the run method is called.

florianeckerstorfer commented 9 years ago

This breaks compatibility with Mac OS X.

Samyoul commented 9 years ago

No problem, I'll just tweak the code.

florianeckerstorfer commented 9 years ago

I just realised, a little bit too late, that your code does not support piping the output of a process into a file. Could you add that feature (I have absolutely no idea how to do this on Windows).

Does stopping a process and checking if it's running work?