You are here

function install_verify_settings in Drupal 6

Same name and namespace in other branches
  1. 5 install.php \install_verify_settings()
  2. 7 includes/install.core.inc \install_verify_settings()

Verify existing settings.php

1 call to install_verify_settings()
install_main in ./install.php
The Drupal installation happens in a series of steps. We begin by verifying that the current environment meets our minimum requirements. We then go on to verify that settings.php is properly configured. From there we connect to the configured database…

File

./install.php, line 176

Code

function install_verify_settings() {
  global $db_prefix, $db_type, $db_url;

  // Verify existing settings (if any).
  if (!empty($db_url)) {

    // We need this because we want to run form_get_errors.
    include_once './includes/form.inc';
    $url = parse_url(is_array($db_url) ? $db_url['default'] : $db_url);
    $db_user = urldecode($url['user']);
    $db_pass = isset($url['pass']) ? urldecode($url['pass']) : NULL;
    $db_host = urldecode($url['host']);
    $db_port = isset($url['port']) ? urldecode($url['port']) : '';
    $db_path = ltrim(urldecode($url['path']), '/');
    $settings_file = './' . conf_path(FALSE, TRUE) . '/settings.php';
    $form_state = array();
    _install_settings_form_validate($db_prefix, $db_type, $db_user, $db_pass, $db_host, $db_port, $db_path, $settings_file, $form_state);
    if (!form_get_errors()) {
      return TRUE;
    }
  }
  return FALSE;
}