示例#1
0
 /**
  * For simple expressions, zero out the time so the cron
  * matches user expectation and does not execute constantly.
  *
  * E.g., someone would not expect "Every day on Tuesday"
  * to run for every minute and hour on Tuesday.
  *
  * @param $field
  */
 protected function nilTime($field)
 {
     $order = array_search($field, $this->cron->ordered());
     if ($order > 1 && !$this->cron->hour->isDirty()) {
         $this->cron->hour->addSpecific(0);
     }
     if ($order > 0 && !$this->cron->minute->isDirty()) {
         $this->cron->minute->addSpecific(0);
     }
 }