You are here

function _feed_import_base_cron_in_time in Feed Import 7.3

Same name and namespace in other branches
  1. 8 feed_import_base/feed_import_base.module \_feed_import_base_cron_in_time()

Helper for cron.

Return value

bool Cron can run

1 call to _feed_import_base_cron_in_time()
feed_import_base_cron in feed_import_base/feed_import_base.module
Implements hook_cron().

File

feed_import_base/feed_import_base.module, line 354
Basic settings for feed import base module

Code

function _feed_import_base_cron_in_time() {
  if (variable_get('feed_import_time_settings', 0)) {

    // Specified interval.
    $time1 = $time2 = 0;
    list($h, $m) = explode(':', variable_get('feed_import_interval_start', '00:00'));
    $time1 = mktime($h, $m, 0);
    list($h, $m) = explode(':', variable_get('feed_import_interval_stop', '00:00'));
    $time2 = mktime($h, $m, 0);
    return $time1 < $time2 && $time1 <= REQUEST_TIME && REQUEST_TIME <= $time2;
  }
  else {
    $last_executed = variable_get('feed_import_last_executed_import', 0);
    $time_between = variable_get('feed_import_time_between_imports', 3600);
    return $last_executed + $time_between < REQUEST_TIME;
  }
}