You are here

public function Tasks::name in Drupal 9

Same name in this branch
  1. 9 core/lib/Drupal/Core/Database/Install/Tasks.php \Drupal\Core\Database\Install\Tasks::name()
  2. 9 core/tests/fixtures/database_drivers/custom/fake/Install/Tasks.php \Drupal\Driver\Database\fake\Install\Tasks::name()
  3. 9 core/tests/fixtures/database_drivers/core/corefake/Install/Tasks.php \Drupal\Core\Database\Driver\corefake\Install\Tasks::name()
  4. 9 core/lib/Drupal/Core/Database/Driver/sqlite/Install/Tasks.php \Drupal\Core\Database\Driver\sqlite\Install\Tasks::name()
  5. 9 core/lib/Drupal/Core/Database/Driver/pgsql/Install/Tasks.php \Drupal\Core\Database\Driver\pgsql\Install\Tasks::name()
  6. 9 core/lib/Drupal/Core/Database/Driver/mysql/Install/Tasks.php \Drupal\Core\Database\Driver\mysql\Install\Tasks::name()
  7. 9 core/tests/fixtures/database_drivers/module/corefake/src/Driver/Database/corefake/Install/Tasks.php \Drupal\corefake\Driver\Database\corefake\Install\Tasks::name()
  8. 9 core/tests/fixtures/database_drivers/module/corefake/src/Driver/Database/corefakeWithAllCustomClasses/Install/Tasks.php \Drupal\corefake\Driver\Database\corefakeWithAllCustomClasses\Install\Tasks::name()
  9. 9 core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Install/Tasks.php \Drupal\driver_test\Driver\Database\DrivertestMysql\Install\Tasks::name()
  10. 9 core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Install/Tasks.php \Drupal\driver_test\Driver\Database\DrivertestPgsql\Install\Tasks::name()
  11. 9 core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysqlDeprecatedVersion/Install/Tasks.php \Drupal\driver_test\Driver\Database\DrivertestMysqlDeprecatedVersion\Install\Tasks::name()
Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Database/Driver/mysql/Install/Tasks.php \Drupal\Core\Database\Driver\mysql\Install\Tasks::name()

Return the human-readable name of the driver.

Overrides Tasks::name

2 methods override Tasks::name()
Tasks::name in core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Install/Tasks.php
Return the human-readable name of the driver.
Tasks::name in core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysqlDeprecatedVersion/Install/Tasks.php
Return the human-readable name of the driver.

File

core/lib/Drupal/Core/Database/Driver/mysql/Install/Tasks.php, line 62

Class

Tasks
Specifies installation tasks for MySQL and equivalent databases.

Namespace

Drupal\Core\Database\Driver\mysql\Install

Code

public function name() {
  try {
    if (!$this
      ->isConnectionActive() || !$this
      ->getConnection() instanceof Connection) {
      throw new ConnectionNotDefinedException('The database connection is not active or not a MySql connection');
    }
    if ($this
      ->getConnection()
      ->isMariaDb()) {
      return $this
        ->t('MariaDB');
    }
    return $this
      ->t('MySQL, Percona Server, or equivalent');
  } catch (ConnectionNotDefinedException $e) {
    return $this
      ->t('MySQL, MariaDB, Percona Server, or equivalent');
  }
}