protected function DatabaseTasks::connect

cis7 install.inc protected DatabaseTasks::connect()
cle7 install.inc protected DatabaseTasks::connect()
elmsmedia7 install.inc protected DatabaseTasks::connect()
icor7 install.inc protected DatabaseTasks::connect()
meedjum_blog7 install.inc protected DatabaseTasks::connect()
mooc7 install.inc protected DatabaseTasks::connect()

Check if we can connect to the database.

1 call to DatabaseTasks::connect()
DatabaseTasks::runTasks in includes/install.inc
Run database tasks and tests to see if Drupal can run on the database.

File

includes/install.inc, line 431
API functions for installing modules and themes.

Class

DatabaseTasks
Database installer structure.

Code

protected function connect() {
  try {
    // This doesn't actually test the connection.
    db_set_active();
    // Now actually do a check.
    Database::getConnection();
    $this->pass('Drupal can CONNECT to the database ok.');
  }
  catch (Exception $e) {
    $this->fail(st('Failed to connect to your database server. The server reports the following message: %error.<ul><li>Is the database server running?</li><li>Does the database exist, and have you entered the correct database name?</li><li>Have you entered the correct username and password?</li><li>Have you entered the correct database hostname?</li></ul>', array('%error' => $e->getMessage())));
    return FALSE;
  }
  return TRUE;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.