Tasks::runTasks

public Tasks::runTasks()

Run database tasks and tests to see if Drupal can run on the database.

Return value

array A list of error messages.

File

core/lib/Drupal/Core/Database/Install/Tasks.php, line 132

Class

Tasks
Database installer structure.

Namespace

Drupal\Core\Database\Install

Code

public function runTasks() {
  // We need to establish a connection before we can run tests.
  if ($this->connect()) {
    foreach ($this->tasks as $task) {
      if (!isset($task['function'])) {
        $task['function'] = 'runTestQuery';
      }
      if (method_exists($this, $task['function'])) {
        // Returning false is fatal. No other tasks can run.
        if (FALSE === call_user_func_array(array($this, $task['function']), $task['arguments'])) {
          break;
        }
      }
      else {
        $this->fail(t("Failed to run all tasks against the database server. The task %task wasn't found.", array('%task' => $task['function'])));
      }
    }
  }
  return $this->results['fail'];
}
doc_Drupal
2016-10-29 09:46:25
Comments
Leave a Comment

Please login to continue.