/**
* {@inheritdoc}
*/
public function buildForm(array
$form, FormStateInterface
$form_state) { // Make sure the install API is available.
include_once DRUPAL_ROOT . '/core/includes/install.inc';
$settings_file = './' .
$this->sitePath . '/settings.php';
$form['#title'
] =
$this->
t('Database configuration'
);
$drivers =
drupal_get_database_types();
$drivers_keys =
array_keys($drivers);
// Unless there is input for this form (for a non-interactive installation,
// input originates from the $settings array passed into install_drupal()),
// check whether database connection settings have been prepared in
// settings.php already.
// Note: The installer even executes this form if there is a valid database
// connection already, since the submit handler of this form is responsible
// for writing all $settings to settings.php (not limited to $databases).
$input = &
$form_state->
getUserInput();
if (!
isset($input['driver'
]) &&
$database = Database::
getConnectionInfo()) {