php - shell_exec() timeout management & exec() -


I am running a third party script which I have written using a wrapper class shell_exec () and Pipes a file into a file which is then parsed using the PHP code. I should tell that it is working, but I am trying to increase the functionality, which I Never thought.

How best is it to manage timeout on shell_exec ()? I was thinking about wrapping it in try () grip () , but I'm not sure how to handle time component best.

I am reading some questions but related to shell_exec () and exec () and it looks like exec () < You can get a return by passing the output parameter for / code>, but it depends on the script with the status of the return. Also in my mini test page, I can not get it to take any output back!

I thought that with the second option, an AJAX style spinner, and setting a manual timeout in Javascript

Is there any acceptable way to use this experiment?

My mini test, including the following,

  public $ e_return = array (); Public $ e_status = ''; // Path / Public Function ExecutionCak ($ ​​domain) is absolute from {exec ($ this- & gt; ssl_check_path. "-s". $ Domain). "-p 443" ". $$$" & Gt; Filename "2 & gt; & amp; 1 & amp; & amp; nbsp; & amp; This- & gt; E-rayton, and $ this-> gt; E_status); }     

I recommend that you proc_open You can configure it to return a stream resource, keep the timer manually, and if the timer expires before the end of the process, then you can call it proc_terminate If this timer expires before the expiration of the timer, then you can use proc_close then stream_get_contents to capture the data Otherwise written in stdout


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -