Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Tasks.php

function Tasks::runTasks

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

Return value

string[] A list of error messages.

File

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

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([
                    $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.", [
                    '%task' => $task['function'],
                ]));
            }
        }
    }
    return $this->results['fail'];
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal