]> git.mjollnir.org Git - moodle.git/commitdiff
Slightly more efficient way to open the database connections
authormoodler <moodler>
Thu, 2 Jan 2003 11:34:00 +0000 (11:34 +0000)
committermoodler <moodler>
Thu, 2 Jan 2003 11:34:00 +0000 (11:34 +0000)
auth/db/lib.php
lib/setup.php

index 6d9eda0ca0bd4efda46bc767775e2ed8474a48fe..6d523d31a4cdd79e097dddee3263929e9488798c 100644 (file)
@@ -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
index a7b9a1e4186154a50473728679484b9872092944..995039bd48d0e102c66aa9a2c6ba3e5b18cd1199 100644 (file)
@@ -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;