You are here

function progress_get_progresses in Background Process 8

Get all progresses.

File

progress/progress.module, line 136
Progress framework for keeping track of progresses. @todo Force MyISAM for table {progress} to avoid transaction/isolation level problems, and use INSERT DELAYED for performance.

Code

function progress_get_progresses() {
  $result = db_select('progress', 'p')
    ->fields('p', [
    'name',
    'progress',
    'message',
    'start_stamp',
    'end_stamp',
    'current_stamp',
  ])
    ->execute();
  $progresses = [];
  foreach ($result as $progress) {
    $progress->start = $progress->start_stamp;
    $progress->end = $progress->end_stamp;
    $progress->current = $progress->current_stamp;
    $progresses[$progress->name] = $progress;
  }
  return $progresses;
}