Skip to content

Instantly share code, notes, and snippets.

@AmyStephen
Created March 17, 2012 07:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AmyStephen/2055972 to your computer and use it in GitHub Desktop.
Save AmyStephen/2055972 to your computer and use it in GitHub Desktop.
$options = array(
'driver' => $database_type,
'host' => $host,
'user' => $user,
'password' => $password,
'database' => $db,
'prefix' => $dbprefix);
try {
$this->db = JDatabaseFactory::getDriver($database_type, $options);
} catch (\RuntimeException $e) {
header('HTTP/1.1 500 Internal Server Error');
exit(0);
}
$this->db->debug($site->debug);
return $this->db;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment