install_verify_database_settings

install_verify_database_settings($site_path)

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.

File

core/includes/install.core.inc, line 1097
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;
}
doc_Drupal
2016-10-29 09:21:05
Comments
Leave a Comment

Please login to continue.