public function 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'];
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Database!Install!Tasks.php/function/Tasks::runTasks/8.1.x