Re: run php in background "atomic" - wild trick
| From: | Teodor Cimpoesu | Date: | Wed, 29 Nov 2000 16:21:16 +0000 |
| Subject: | Re: run php in background "atomic" - wild trick | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-27825@lists.php.net to get a copy of this message | ||
Hi Leonardo!
On Wed, 29 Nov 2000, Leonardo Dias wrote:
> Hello, Teodor and Mailing list,
>
> > I've done it in an hackish way, which sometimes worked, sometime didn't
> > namely, if you don't expect any output from the program being spawned,
> > register a function with register_shutdown_function() and execute it there.
> > Don't forget to ignore_user_abort() and set_time_limit() higher.
>
> But then you won't be sure if the function was executed or not, right?
> What if we need it to be executed?
The docs say nothing about it's "run probability", so you must take it as
certain to execute. Just that one cannot debug easily (i.e. echos) and I
had some trouble w/ it.
I wasn't certain it works 100% because it worked great on a test site
then it didn't for unkown reasons. So maybe I did something stupid,
I dunno -- at that rush time I hadn't had any time to check it out.
Still,I think it's a good workaround for the popen(3) blocking, which
sucks on time-expensive mail()/exec()/system() calls.
-- teodor