You are here

public static function UltimateCronProgressMemcache::getProgressMultiple in Ultimate Cron 7.2

Get multiple job progresses.

Parameters

array $names: Job names to get progress for.

Return value

array Progress of jobs, keyed by job name.

File

./ultimate_cron.memcache-progress.inc, line 69
Pseudo namespace for progress functions.

Class

UltimateCronProgressMemcache
Class for using memcache as storage for progress.

Code

public static function getProgressMultiple($names) {
  $keys = array();
  foreach ($names as $name) {
    $keys[] = 'uc-progress:' . $name;
  }
  $bin = variable_get('ultimate_cron_progress_memcache_bin', 'progress');
  $values = dmemcache_get_multi($keys, $bin);
  $result = array();
  foreach ($names as $name) {
    $result[$name] = isset($values['uc-progress:' . $name]) ? $values['uc-progress:' . $name] : FALSE;
  }
  return $result;
}