summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/db.inc.php
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-04-21 14:02:18 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-04-21 14:02:18 +0000
commit00ea8cd431aa8e54993e49b827cdb234306d06cf (patch)
tree1ce035068c43683c3abedb82dc2c0c7996f8250f /frontends/php/include/db.inc.php
parent985ef1d5031e25ccd9c0c076f17c5bbb3eb734d1 (diff)
downloadzabbix-00ea8cd431aa8e54993e49b827cdb234306d06cf.tar.gz
zabbix-00ea8cd431aa8e54993e49b827cdb234306d06cf.tar.xz
zabbix-00ea8cd431aa8e54993e49b827cdb234306d06cf.zip
- [DEV-137] added support of old-style configfile (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5642 97f52cf1-0a1b-0410-bd0e-c28be96e8082
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;