You are here

public function UltimateCronBackgroundProcessLegacyLauncher::isValid in Ultimate Cron 7.2

Only expose this plugin, if Background Process is 1.x.

Overrides UltimateCronPlugin::isValid

File

plugins/ultimate_cron/launcher/background_process_legacy.class.php, line 110
Background Process 1.x launcher for Ultimate Cron.

Class

UltimateCronBackgroundProcessLegacyLauncher
Ultimate Cron launcher plugin class.

Code

public function isValid($job = NULL) {
  static $correct_version;
  if (!isset($correct_version)) {
    $correct_version = FALSE;

    // Interimistic way of determining version of Background Process.
    // Background Process 1.x has a dependency on the Progress module.
    if (module_exists('background_process')) {
      $info = system_get_info('module', 'background_process');
      if (!empty($info['dependencies']) && in_array('progress', $info['dependencies'])) {
        $correct_version = TRUE;
      }
    }
  }
  return $correct_version && parent::isValid($job);
}