The current implementation of uv_spawn in php-uv does not allow to get the PID of the newly spawned process. libuv sets the pid in the uv_process_t after calling uv_spawn. php-uv here returns an empty UVProcess class instances (in several other places empty classes are returned too, not limited to fs operations). This makes it impossible to get the PID of the spawned process.
The easiest solution here is to not return an empty class, but use the class and give it some properties.
The current implementation of
uv_spawn
in php-uv does not allow to get the PID of the newly spawned process. libuv sets thepid
in theuv_process_t
after callinguv_spawn
. php-uv here returns an emptyUVProcess
class instances (in several other places empty classes are returned too, not limited to fs operations). This makes it impossible to get the PID of the spawned process.The easiest solution here is to not return an empty class, but use the class and give it some properties.