2

I found a little bit of documentation here: http://php.net/manual/en/function.posix-setpgid.php http://www.php.net/manual/en/function.posix-getpgid.php

But I really am not sure how to do this. I have a folder with php scripts. When I click a button, one or more of the scripts will run. Now what I need is quite common, I think- but I don't know how to do it: I want to identify which of the scripts is running and display a proper message. For example if apple.php is currently the script running, I would want attach a message to my progressbar saying: "Eating apple, please wait..." or so.
When the script is complete, the next script might be berries.php and the message "Eating berries, please wait".
I guess what I need to do would be to give an id or tag to each of the scripts and somehow identify them by the id, and display the message. Also, as I can see in the documentation, there is some kind of group id, for example "feeding actions" that can be set. Since running those scripts will be triggered by clicking a single button, I would like to set a group name for those scripts.
Maybe it is more simple than that, but this is what came into my mind for now.

Cornelia Secelean
  • 403
  • 1
  • 4
  • 14
  • we have one common thread going on [here][1] [1]: http://stackoverflow.com/questions/4221333/get-the-current-script-file-name – Bala Varadarajan May 13 '13 at 14:03
  • @BalaVaradarajan not really the same: Suppose I have 3 php scripts running (one after another), they are running in the background (**not the currently opened file**). So what I will need to do will be: if the script had started, display "eating apple" until the script stops. When a new script starts, display a proper message. I'm not really sure how to use it in that case. One possible problem would be to get your script if other scripts are running meanwhile. How will they be distinguished? – Cornelia Secelean May 13 '13 at 14:33
  • get the process id with your OS? ... – SparK Jan 24 '17 at 19:59

0 Answers0