You are here

function __cronNextOrEqual in Elysia Cron 5.2

Same name and namespace in other branches
  1. 5 elysia_cron_scheduler.inc \__cronNextOrEqual()
  2. 6.2 elysia_cron_scheduler.inc \__cronNextOrEqual()
  3. 6 elysia_cron_scheduler.inc \__cronNextOrEqual()
  4. 7 elysia_cron_scheduler.inc \__cronNextOrEqual()
1 call to __cronNextOrEqual()
_elysia_cron_next_run in ./elysia_cron_scheduler.inc

File

./elysia_cron_scheduler.inc, line 95

Code

function __cronNextOrEqual($el, $arr, $range_start, $range_end) {
  if (empty($arr)) {
    return $el;
  }
  foreach ($arr as $x) {
    if ($x >= $el) {
      return $x;
    }
  }
  return $range_end + reset($arr) + 1 - $range_start;
}