Xu Wei Jie Posted March 8, 2009 Share Posted March 8, 2009 Is there any command in PHP that will halt the execution process of an application? I wish to implement a debug function thus this function will print out a debugging message and stop or continue the execution process based on an expression that is evaluated to true or false. Would appreciate any help from all of you. =) Quote Link to comment https://forums.phpfreaks.com/topic/148440-solved-halting-the-php-execution-process/ Share on other sites More sharing options...
corbin Posted March 8, 2009 Share Posted March 8, 2009 If you want to pause execution for a specific amount of time, you can use sleep(). If you want to halt execution, you can use exit. http://php.net/sleep http://php.net/exit (Exit is a construct, so it can be used like 'exit;', but it's also valid to use something like exit('This message would be output right before script execution is halted.') Quote Link to comment https://forums.phpfreaks.com/topic/148440-solved-halting-the-php-execution-process/#findComment-779323 Share on other sites More sharing options...
Xu Wei Jie Posted March 9, 2009 Author Share Posted March 9, 2009 Thanks. I need an idea on how to halt an entire application because exit only halt a particular execution process. Basically my application invokes system() recursively within the scripts (i.e. system("php xxx.php",$retval); ) Thus if I invoke exit, it may only halt one particular execution process but not the entire application. Any idea here? =) Quote Link to comment https://forums.phpfreaks.com/topic/148440-solved-halting-the-php-execution-process/#findComment-780404 Share on other sites More sharing options...
JonnoTheDev Posted March 9, 2009 Share Posted March 9, 2009 Maybe set a flag in a text file. Each process caould read the file proir to execution. If the flag is set the process terminates or is not invoked. Quote Link to comment https://forums.phpfreaks.com/topic/148440-solved-halting-the-php-execution-process/#findComment-780438 Share on other sites More sharing options...
Xu Wei Jie Posted March 9, 2009 Author Share Posted March 9, 2009 Thanks for the idea. It is useful =) Quote Link to comment https://forums.phpfreaks.com/topic/148440-solved-halting-the-php-execution-process/#findComment-780510 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.