You are here

function CronRule::preProcessRule in Ultimate Cron 6

Same name and namespace in other branches
  1. 8 CronRule.class.php \CronRule::preProcessRule()
  2. 7.2 CronRule.class.php \CronRule::preProcessRule()
  3. 7 CronRule.class.php \CronRule::preProcessRule()

Pre process rule.

Parameters

array &$parts:

1 call to CronRule::preProcessRule()
CronRule::getIntervals in ./CronRule.class.php
Generate regex rules

File

./CronRule.class.php, line 94
This class parses cron rules and determines last execution time using least case integer comparison.

Class

CronRule
@file

Code

function preProcessRule(&$parts) {

  // Allow JAN-DEC
  $months = array(
    1 => 'jan',
    'feb',
    'mar',
    'apr',
    'may',
    'jun',
    'jul',
    'aug',
    'sep',
    'oct',
    'nov',
    'dec',
  );
  $parts[3] = strtr(strtolower($parts[3]), array_flip($months));

  // Allow SUN-SUN
  $days = array(
    'sun',
    'mon',
    'tue',
    'wed',
    'thu',
    'fri',
    'sat',
  );
  $parts[4] = strtr(strtolower($parts[4]), array_flip($days));
  $parts[4] = str_replace('7', '0', $parts[4]);
}