Use a Daemon object for process locking

This commit is contained in:
2011-12-31 02:10:06 +00:00
parent 0eabec90ba
commit c13090b472

View File

@@ -0,0 +1,25 @@
<?php
class DownloadDispatcher_Main extends SihnonFramework_Main {
protected $daemon;
public function __construct() {
parent::__construct();
}
public function init() {
parent::init();
try {
$this->daemon = new DownloadDispatcher_Daemon($this->config);
} catch (SihnonFramework_Exception_AlreadyRunning $e) {
DownloadDispatcher_LogEntry::error($this->log, "Another instance is already running, exiting this process now.");
exit(0);
}
}
}
?>