function Tasks::getFormOptions

Same name in this branch
  1. 10 core/modules/sqlite/src/Driver/Database/sqlite/Install/Tasks.php \Drupal\sqlite\Driver\Database\sqlite\Install\Tasks::getFormOptions()
  2. 10 core/modules/pgsql/src/Driver/Database/pgsql/Install/Tasks.php \Drupal\pgsql\Driver\Database\pgsql\Install\Tasks::getFormOptions()
  3. 10 core/lib/Drupal/Core/Database/Install/Tasks.php \Drupal\Core\Database\Install\Tasks::getFormOptions()
Same name in other branches
  1. 9 core/modules/sqlite/src/Driver/Database/sqlite/Install/Tasks.php \Drupal\sqlite\Driver\Database\sqlite\Install\Tasks::getFormOptions()
  2. 9 core/modules/mysql/src/Driver/Database/mysql/Install/Tasks.php \Drupal\mysql\Driver\Database\mysql\Install\Tasks::getFormOptions()
  3. 9 core/modules/pgsql/src/Driver/Database/pgsql/Install/Tasks.php \Drupal\pgsql\Driver\Database\pgsql\Install\Tasks::getFormOptions()
  4. 9 core/lib/Drupal/Core/Database/Install/Tasks.php \Drupal\Core\Database\Install\Tasks::getFormOptions()
  5. 8.9.x core/lib/Drupal/Core/Database/Driver/sqlite/Install/Tasks.php \Drupal\Core\Database\Driver\sqlite\Install\Tasks::getFormOptions()
  6. 8.9.x core/lib/Drupal/Core/Database/Driver/mysql/Install/Tasks.php \Drupal\Core\Database\Driver\mysql\Install\Tasks::getFormOptions()
  7. 8.9.x core/lib/Drupal/Core/Database/Driver/pgsql/Install/Tasks.php \Drupal\Core\Database\Driver\pgsql\Install\Tasks::getFormOptions()
  8. 8.9.x core/lib/Drupal/Core/Database/Install/Tasks.php \Drupal\Core\Database\Install\Tasks::getFormOptions()
  9. 11.x core/modules/sqlite/src/Driver/Database/sqlite/Install/Tasks.php \Drupal\sqlite\Driver\Database\sqlite\Install\Tasks::getFormOptions()
  10. 11.x core/modules/mysql/src/Driver/Database/mysql/Install/Tasks.php \Drupal\mysql\Driver\Database\mysql\Install\Tasks::getFormOptions()
  11. 11.x core/modules/pgsql/src/Driver/Database/pgsql/Install/Tasks.php \Drupal\pgsql\Driver\Database\pgsql\Install\Tasks::getFormOptions()
  12. 11.x core/lib/Drupal/Core/Database/Install/Tasks.php \Drupal\Core\Database\Install\Tasks::getFormOptions()

Overrides Tasks::getFormOptions

File

core/modules/mysql/src/Driver/Database/mysql/Install/Tasks.php, line 135

Class

Tasks
Specifies installation tasks for MySQL and equivalent databases.

Namespace

Drupal\mysql\Driver\Database\mysql\Install

Code

public function getFormOptions(array $database) {
    $form = parent::getFormOptions($database);
    if (empty($form['advanced_options']['port']['#default_value'])) {
        $form['advanced_options']['port']['#default_value'] = '3306';
    }
    $form['advanced_options']['isolation_level'] = [
        '#type' => 'select',
        '#title' => $this->t('Transaction isolation level'),
        '#options' => [
            'READ COMMITTED' => $this->t('READ COMMITTED'),
            'REPEATABLE READ' => $this->t('REPEATABLE READ'),
            '' => $this->t('Use database default'),
        ],
        '#default_value' => $database['isolation_level'] ?? 'READ COMMITTED',
        '#description' => $this->t('The recommended database transaction level for Drupal is "READ COMMITTED". For more information, see the <a href=":performance_doc">setting MySQL transaction isolation level</a> page.', [
            ':performance_doc' => 'https://www.drupal.org/docs/system-requirements/setting-the-mysql-transaction-isolation-level',
        ]),
    ];
    return $form;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.