You are here

function install_verify_database_settings in Drupal 10

Same name and namespace in other branches
  1. 8 core/includes/install.core.inc \install_verify_database_settings()
  2. 9 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 1150
API functions for installing Drupal.

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;
}