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

Breadcrumb

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

function Tasks::runTestQuery

Ensures the database can execute commands with the current user.

File

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

Class

Tasks
Database installer structure.

Namespace

Drupal\Core\Database\Install

Code

protected function runTestQuery($query, $pass, $fail, $fatal = FALSE) {
    try {
        Database::getConnection()->query($query);
        $this->pass(t($pass));
    } catch (\Exception $e) {
        $this->fail(t($fail, [
            '%query' => $query,
            '%error' => $e->getMessage(),
            '%name' => $this->name(),
        ]));
        return !$fatal;
    }
}

API Navigation

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