You are here

function install_tasks_to_perform in Drupal 7

Same name and namespace in other branches
  1. 8 core/includes/install.core.inc \install_tasks_to_perform()
  2. 9 core/includes/install.core.inc \install_tasks_to_perform()

Returns a list of tasks to perform during the current installation request.

Note that the list of tasks can change based on the installation state as the page request evolves (for example, if an installation profile hasn't been selected yet, we don't yet know which profile tasks need to be run).

You can override this using hook_install_tasks() or hook_install_tasks_alter().

Parameters

$install_state: An array of information about the current installation state.

Return value

A list of tasks to be performed, with associated metadata as returned by hook_install_tasks().

1 call to install_tasks_to_perform()
install_run_tasks in includes/install.core.inc
Runs all tasks for the current installation request.

File

includes/install.core.inc, line 492
API functions for installing Drupal.

Code

function install_tasks_to_perform($install_state) {

  // Start with a list of all currently available tasks.
  $tasks = install_tasks($install_state);
  foreach ($tasks as $name => $task) {

    // Remove any tasks that were already performed or that never should run.
    // Also, if we started this page request with an indication of the last
    // task that was completed, skip that task and all those that come before
    // it, unless they are marked as always needing to run.
    if ($task['run'] == INSTALL_TASK_SKIP || in_array($name, $install_state['tasks_performed']) || !empty($install_state['completed_task']) && empty($completed_task_found) && $task['run'] != INSTALL_TASK_RUN_IF_REACHED) {
      unset($tasks[$name]);
    }
    if (!empty($install_state['completed_task']) && $name == $install_state['completed_task']) {
      $completed_task_found = TRUE;
    }
  }
  return $tasks;
}