Jobby\Helper::getHost PHP Метод

getHost() публичный Метод

public getHost ( ) : string
Результат string
    public function getHost()
    {
        return php_uname('n');
    }

Usage Example

Пример #1
0
 /**
  * @return bool
  */
 protected function shouldRun()
 {
     if (!$this->config['enabled']) {
         return false;
     }
     if ($this->config['haltDir'] !== null) {
         $flag_file = $this->config['haltDir'] . DIRECTORY_SEPARATOR . $this->job;
         if (file_exists($flag_file)) {
             return false;
         }
     }
     $schedule = \DateTime::createFromFormat('Y-m-d H:i:s', $this->config['schedule']);
     if ($schedule !== false) {
         return $schedule->format('Y-m-d H:i') == date('Y-m-d H:i');
     }
     $cron = CronExpression::factory($this->config['schedule']);
     if (!$cron->isDue()) {
         return false;
     }
     $host = $this->helper->getHost();
     if (strcasecmp($this->config['runOnHost'], $host) != 0) {
         return false;
     }
     return true;
 }
All Usage Examples Of Jobby\Helper::getHost