1 install.core.inc install_settings_form_submit($form, &$form_state)

Form submission handler for install_settings_form().

See also

install_settings_form_validate()

File

core/includes/install.core.inc, line 1073
API functions for installing Backdrop.

Code

function install_settings_form_submit($form, &$form_state) {
  global $install_state;

  // Update global settings array and save.
  $db_settings = $form_state['storage']['database'];
  $settings['database'] = array(
    'value' => $db_settings['driver'] . '://' . rawurlencode($db_settings['username']) . ':' . rawurlencode($db_settings['password']) . '@' . $db_settings['host'] . ($db_settings['port'] ? (':' . $db_settings['port']) : '') . '/' . rawurlencode($db_settings['database']),
    'required' => TRUE,
  );
  $settings['database_prefix'] = array(
    'value' => $db_settings['prefix'],
  );
  backdrop_rewrite_settings($settings);

  // Check if UTF-8 MB4 support exists in the database and add to settings.php.
  if (install_verify_database_utf8mb4()) {
    $settings = array();
    $settings['database_charset'] = array(
      'value' => 'utf8mb4',
      'required' => TRUE,
    );
    backdrop_rewrite_settings($settings);
  }

  // Indicate that the settings file has been verified, and check the database
  // for the last completed task, now that we have a valid connection. This
  // last step is important since we want to trigger an error if the new
  // database already has Backdrop installed.
  $install_state['settings_verified'] = TRUE;
  $install_state['completed_task'] = install_verify_completed_task();
}