Exemplo n.º 1
0
 public function __construct(HealthetyWorkerOptions $options)
 {
     if ($options->getOption('host') !== false) {
         $this->server = $options->getOption('host');
     }
     if ($options->getOption('port') !== false) {
         $this->port = $options->getOption('port');
     }
     $this->_host = gethostname();
 }
Exemplo n.º 2
0
 public function __construct(HealthetyWorkerTransmission $transmission, HealthetyWorkerOptions $options)
 {
     if ($options->getOption('name') !== false) {
         $this->_name = $options->getOption('name');
     }
     if ($options->getOption('interval') !== false) {
         $this->_interval = $options->getOption('interval');
     }
     if ($options->getOption('value') !== false) {
         $this->_value = $options->getOption('value');
     }
     if (isset($transmission) && !empty($transmission)) {
         $this->transmission = $transmission;
     } else {
         throw new Exception("No transmission given!");
     }
 }