Login   Register  
PHP Classes
elePHPant
Icontem

clsDaemonize: Create and manage daemon processes on Unix systems

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2004-06-03 (10 years ago) RSS 2.0 feedStarStarStar 50%Total: 1,799 All time: 2,032 This week: 1,387Up
Version License Categories  
clsdaemonize 1.0GNU General Public Lice...Unix
Description Author  

This class is intended to automate the creation of system daemons proceses under Unix like operating systems or those with POSIX compliant API like Linux, OpenBSD, FreeBSD, Solaris, Mac OS X, etc...

It can fork a new process using the PHP pcntl extension and detach from the starting shell so it can exit without killing the daemon process.

It can maintain a file that stores the daemon process identifier to prevent that more than one copy of the daemon is started.

It also creates a log file to register the daemon activity.

It is also possible register PHP callback functions to handle different types of signals.

Innovation Award  
PHP Programming Innovation award nominee
June 2004
Number 7
A daemon is what are usually called the programs that run on their own under Unix/Linux based systems.

Thy usually implement services of handling events that may occur any time. Examples of daemon services include network connection handlers, mail processors, print spoolers, etc..

This class provides a solution that simplifies the implementation common details of operation of daemons, like being able to detach from the shell process that started it and so not end even if the starting process exits, assure that only one copy of the same daemon is running, handle signals that request termination, etc..

Even though running daemon scripts is not the a common use of PHP, this class simplifies the development of new useful daemons that may enhance the value of many PHP applications.

Manuel Lemos
Picture of Daniel Andres Marjos
Name: Daniel Andres Marjos is available for providing paid consulting. Contact Daniel Andres Marjos .
Classes: 13 packages by
Country: Argentina Argentina
Age: 44
All time rank: 231 in Argentina Argentina
Week rank: 305 Down1 in Argentina Argentina Equal
Innovation award
Innovation award
Nominee: 2x

  Files folder image Files  
File Role Description
Plain text file clsDaemonize.php Class Main Class file
Accessible without login Plain text file test_daemon.php Example Example Script

 Version Control Unique User Downloads Download Rankings  
 0%Total:1,799All time:2,032
 This week:0This week:1,387Up
 User Ratings  
 
 All time
Utility:75%StarStarStarStar
Consistency:75%StarStarStarStar
Documentation:-
Examples:54%StarStarStar
Tests:-
Videos:-
Overall:50%StarStarStar
Rank:1609