You are here

public static function JobSchedulerCronTab::parse in Job Scheduler 7.2

Parse full crontab string into an array of type => values.

Note this one is static and can be used to validate values.

2 calls to JobSchedulerCronTab::parse()
JobSchedulerCronTab::__construct in ./JobSchedulerCronTab.inc
Constructor.
job_scheduler_trigger_edit_form_validate in modules/job_scheduler_trigger/job_scheduler_trigger.admin.inc
Validate trigger.

File

./JobSchedulerCronTab.inc, line 54
JobSchedulerCronTab class.

Class

JobSchedulerCronTab
Jose's cron tab parser = Better try only simple crontab strings.

Code

public static function parse($crontab) {

  // Crontab elements, names match PHP date indexes (getdate)
  // Example:
  // $keys = array('minutes', 'hours', 'mday', 'mon', 'wday');
  // Replace multiple spaces by single space.
  $crontab = preg_replace('/(\\s+)/', ' ', $crontab);

  // Expand into elements and parse all.
  $values = explode(' ', trim($crontab));
  return self::values($values);
}