Name: LiipProcessManager
Owner: Liip
Description: Provides a simple locking mechanism based on UNIX process id's written to a "PID file".
Created: 2011-11-10 17:09:16.0
Updated: 2017-02-11 16:34:36.0
Pushed: 2014-07-30 07:42:32.0
Homepage: http://liip.ch
Size: 193
Language: PHP
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Provides a simple locking mechanism based on UNIX process id's written to a “PID file”.
http://github.com/liip/LiipProcessManager.git
Here is a simple example
p
Liip\ProcessManager\ProcessManager;
Liip\ProcessManager\PidFile;
un a process in the back ground
cessManager = new ProcessManager();
= $processManager->execProcess('sleep 10m');
cessManager->isProcessRunning($pid)
cessManager->killProcess($pid);
o set log location instead of routing it to /dev/null by default
cessManager = new ProcessManager('/path/to/logfile');
= $processManager->execProcess('sleep 10m');
cquire a lock via a pid file
k = new PidFile(new ProcessManager(), '/tmp/foobar');
k->acquireLock();
= $lock->execProcess('sleep 10m');
et the PID which should be locked on
k->setPid(getmypid());
k->releaseLock();