You are here

public function Tasks::getFormOptions in Drupal driver for SQL Server and SQL Azure 3.0.x

Same name and namespace in other branches
  1. 8.2 drivers/lib/Drupal/Driver/Database/sqlsrv/Install/Tasks.php \Drupal\Driver\Database\sqlsrv\Install\Tasks::getFormOptions()
  2. 8 drivers/lib/Drupal/Driver/Database/sqlsrv/Install/Tasks.php \Drupal\Driver\Database\sqlsrv\Install\Tasks::getFormOptions()

Return driver specific configuration options.

Parameters

$database: An array of driver specific configuration options.

Return value

The options form array.

Overrides Tasks::getFormOptions

File

drivers/lib/Drupal/Driver/Database/sqlsrv/Install/Tasks.php, line 179

Class

Tasks
Specifies installation tasks for PostgreSQL databases.

Namespace

Drupal\Driver\Database\sqlsrv\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'] = '1433';
  }
  $form['advanced_options']['schema'] = [
    '#type' => 'textfield',
    '#title' => t('Schema'),
    '#default_value' => empty($database['schema']) ? 'dbo' : $database['schema'],
    '#size' => 10,
    '#required' => FALSE,
  ];
  $form['advanced_options']['cache_schema'] = [
    '#type' => 'checkbox',
    '#title' => t('Cache Schema Definitions'),
    '#description' => t('Allow the table schema to be cached. This will significantly speed up the site, but the schema must be stable.'),
    '#return_value' => 'true',
  ];

  // Make username not required.
  $form['username']['#required'] = FALSE;

  // Add a description for about leaving username blank.
  $form['username']['#description'] = t('Leave username (and password) blank to use Windows authentication.');
  return $form;
}