Login   Register  
PHP Classes
elePHPant
Icontem

Not tested yet - but appears to stand out as a well written a...

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      Power Process  >  All threads  >  Not tested yet - but appears to stand out as a well written a...  >  (Un) Subscribe thread alerts  
Subject:Not tested yet - but appears to stand out as a well written a...
Summary:Package rating comment
Messages:4
Author:Colin McKinnon
Date:2012-01-09 14:26:56
Update:2012-01-12 18:34:03
 

Colin McKinnon rated this package as follows:

Utility: Good
Consistency: Sufficient
Documentation: Sufficient
Examples: Sufficient

  1. Not tested yet - but appears to stand out as a well written a...   Reply  
Picture of Colin McKinnon
Colin McKinnon
2012-01-09 14:26:56
Not tested yet - but appears to stand out as a well written and functionally correct example of how to manage processes on a Unix system (there are a huge number of very badly written ones in the wild).

Might benefit from an idiots guide as to how to use (and not to use) the class - particularly when invoked via a web request).

Good job!

  2. Re: Not tested yet - but appears to stand out as a well written   Reply  
Picture of Don Bauer
Don Bauer
2012-01-10 13:48:21 - In reply to message 1 from Colin McKinnon
Thanks! I am putting together a guide as I finish tightening up some loose ends. I appreciate the comments!

I have not tested invoking this from a web request as it is designed more for command line scripts, but I will try it out and see what happens.

  3. Re: Not tested yet - but appears to stand out as a well written   Reply  
Picture of Tomi Helevä
Tomi Helevä
2012-01-10 22:34:13 - In reply to message 2 from Don Bauer
Quote from php.net (sean dot kelly at mediatile dot com 09-Jan-2012 09:32):
-----------------------------------------------------
The following statement left me searching for answers for about a day before I finally clued in:

"Process Control should not be enabled within a web server environment and unexpected results may happen if any Process Control functions are used within a web server environment."

At least for PHP 5.3.8 which I am using, and who knows how far back, it's not a matter of "should not", it's "can not". Even though I have compiled in PCNTL with --enable-pcntl, it turns out that it only compiles in to the CLI version of PHP, not the Apache module. As a result, I spent many hours trying to track down why function_exists('pcntl_fork') was returning false even though it compiled correctly. It turns out it returns true just fine from the CLI, and only returns false for HTTP requests. The same is true of ALL of the pcntl_*() functions.
-----------------------------------------------------

So, it would seem that this is only possible with CLI.

  4. Re: Not tested yet - but appears to stand out as a well written   Reply  
Picture of Don Bauer
Don Bauer
2012-01-12 18:34:03 - In reply to message 3 from Tomi Helevä
Yeah, having reviewed everything more, I can see no reason that would need (or want to) invoke this class from a web script. It was designed with the command line in mind and from the sounds of it, that is the only way you can use it whether you wanted to try something else with it or not.

I work for a communications company and I use it to process huge amounts of data prior to generating excel reports. We also use it to create process daemons that perform tasks such as database enrichment and job automation.