You are here

public function Tasks::getFormOptions in MongoDB 8

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/mongodb/Install/Tasks.php, line 53

Class

Tasks

Namespace

Drupal\Driver\Database\mongodb\Install

Code

public function getFormOptions(array $database) {
  $form = parent::getFormOptions($database);

  // Remove the options that only apply to client/server style databases.
  unset($form['username'], $form['password'], $form['advanced_options']['host'], $form['advanced_options']['port']);

  // Make the text more accurate for MongoDB.
  $form['database']['#title'] = t('Connection string');
  $form['database']['#description'] = t('The connection string to the MongoDB install/cluster where @drupal data will be stored.', array(
    '@drupal' => drupal_install_profile_distribution_name(),
  ));
  $default_database = 'mongodb://localhost:27017';
  $form['database']['#default_value'] = empty($database['database']) ? $default_database : $database['database'];
  return $form;
}