Ejemplo n.º 1
0
 /**
  * Initialize the daemon
  *
  * @return void
  */
 protected function initDaemon()
 {
     $daemon = Daemon::getInstance();
     if (!$daemon) {
         throw new \Exception('Couldn\'t create instance, hopefully you got some error messages on console or in the log file.');
     }
     if (isset($this->options['once'])) {
         $daemon->setRunOnce();
     }
     $daemon->setWorkingDir($this->options['working-dir']);
     $daemon->setProjectDir($this->options['project-dir']);
     $daemon->setStatusDir($this->options['status-dir']);
     if (isset($this->options['project-file'])) {
         $daemon->addProjectFiles($this->options['project-file']);
     }
     return $daemon;
 }
Ejemplo n.º 2
0
 public function runDaemon()
 {
     Daemon::getInstance()->run();
 }