From fa3ba0f6c1b3be9897a5f36cbb39d57115649272 Mon Sep 17 00:00:00 2001
From: moodler <moodler>
Date: Thu, 2 Jan 2003 11:34:00 +0000
Subject: [PATCH] Slightly more efficient way to open the database connections

---
 auth/db/lib.php | 3 +--
 lib/setup.php   | 5 +++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/auth/db/lib.php b/auth/db/lib.php
index 6d9eda0ca0..6d523d31a4 100644
--- a/auth/db/lib.php
+++ b/auth/db/lib.php
@@ -8,8 +8,7 @@ function auth_user_login ($username, $password) {
 
     global $CFG;
 
-    ADOLoadCode($CFG->auth_dbtype);          
-    $authdb = &ADONewConnection();         
+    $authdb = &ADONewConnection($CFG->auth_dbtype);         
     $authdb->PConnect($CFG->auth_dbhost,$CFG->auth_dbuser,$CFG->auth_dbpass,$CFG->auth_dbname); 
 
     switch ($CFG->auth_dbpasstype) {   // Re-format password accordingly
diff --git a/lib/setup.php b/lib/setup.php
index a7b9a1e418..995039bd48 100644
--- a/lib/setup.php
+++ b/lib/setup.php
@@ -16,8 +16,9 @@
 /// Connect to the database using adodb
 
     require("$CFG->libdir/adodb/adodb.inc.php"); // Database access functions
-    ADOLoadCode($CFG->dbtype);          
-    $db = &ADONewConnection();         
+
+    $db = &ADONewConnection($CFG->dbtype);         
+
     if (! $db->PConnect($CFG->dbhost,$CFG->dbuser,$CFG->dbpass,$CFG->dbname)) {
         echo "<P><FONT COLOR=RED>The database details specified in config.php are not correct, or the database is down.</P>";
         die;
-- 
2.39.5