Example #1
0
 /**
  *
  */
 public function start()
 {
     $this->init();
     $this->checkPidFile();
     $this->daemon = $this->factory();
     $this->daemon->start();
 }
Example #2
0
 /**
  * @param $tasks array
  * @param LoggerInterface $logger
  */
 public function __construct($tasks, LoggerInterface $logger = null)
 {
     $this->setTasks($tasks);
     if (is_null($logger)) {
         $logger = CrontabLoggerFactory::getInstance(self::LOG_FILE);
     }
     parent::__construct($logger);
 }
Example #3
0
 /**
  * @param $tasks array
  * @param $logfile string
  */
 public function __construct($tasks, $logfile = null)
 {
     $this->setTasks($tasks);
     $logger = new Logger("php_crontab");
     if (!empty($logfile)) {
         $logger->pushHandler(new StreamHandler($logfile));
     } else {
         $logger->pushHandler(new StreamHandler(self::LOG_FILE));
     }
     $this->logger = $logger;
     parent::__construct($logger);
 }