install_verify_completed_task

install_verify_completed_task()

Verifies and returns the last installation task that was completed.

Return value

The last completed task, if there is one. An exception is thrown if Drupal is already installed.

File

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

Code

function install_verify_completed_task() {
  try {
    $task = \Drupal::state()->get('install_task');
  }
  // Do not trigger an error if the database query fails, since the database
  // might not be set up yet.
  catch (\Exception $e) {
  }
  if (isset($task)) {
    if ($task == 'done') {
      throw new AlreadyInstalledException(\Drupal::service('string_translation'));
    }
    return $task;
  }
}
doc_Drupal
2016-10-29 09:21:04
Comments
Leave a Comment

Please login to continue.