function install_verify_database_settings

Same name in other branches
  1. 9 core/includes/install.core.inc \install_verify_database_settings()
  2. 8.9.x core/includes/install.core.inc \install_verify_database_settings()
  3. 11.x core/includes/install.core.inc \install_verify_database_settings()

Verifies that settings.php specifies a valid database connection.

Parameters

string $site_path: The site path.

Return value

bool TRUE if there are no database errors.

1 call to install_verify_database_settings()
install_begin_request in core/includes/install.core.inc
Begins an installation request, modifying the installation state as needed.

File

core/includes/install.core.inc, line 1171

Code

function install_verify_database_settings($site_path) {
    if ($database = Database::getConnectionInfo()) {
        $database = $database['default'];
        $settings_file = './' . $site_path . '/settings.php';
        $errors = install_database_errors($database, $settings_file);
        if (empty($errors)) {
            return TRUE;
        }
    }
    return FALSE;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.