summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/db.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'frontends/php/include/db.inc.php')
-rw-r--r--frontends/php/include/db.inc.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/frontends/php/include/db.inc.php b/frontends/php/include/db.inc.php
index defaad6a..b52e74ac 100644
--- a/frontends/php/include/db.inc.php
+++ b/frontends/php/include/db.inc.php
@@ -19,13 +19,20 @@
**/
?>
<?php
- global $DB;
-
function DBconnect(&$error){
$result = true;
- global $DB;
-
+ global $DB, $DB_TYPE, $DB_SERVER, $DB_PORT, $DB_DATABASE, $DB_USER, $DB_PASSWORD;
+
+ if(!isset($DB)){
+ if(isset($DB_TYPE)) $DB['TYPE'] = $DB_TYPE;
+ if(isset($DB_SERVER)) $DB['SERVER'] = $DB_SERVER;
+ if(isset($DB_PORT)) $DB['PORT'] = $DB_PORT;
+ if(isset($DB_DATABASE)) $DB['DATABASE'] = $DB_DATABASE;
+ if(isset($DB_USER)) $DB['USER'] = $DB_USER;
+ if(isset($DB_PASSWORD)) $DB['PASSWORD'] = $DB_PASSWORD;
+ }
+
$DB['DB'] = null;
$DB['TRANSACTIONS'] = 0;