diff options
| author | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-06-10 10:15:24 +0000 |
|---|---|---|
| committer | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-06-10 10:15:24 +0000 |
| commit | d2b78889450f7256e878376e71fe025191060af9 (patch) | |
| tree | 540ba58c047c872ee1b7dd37ed89d8382780a3f0 /frontends/php/include/db.inc.php | |
| parent | a13221c0a0e7b56cf6f2175ff5c0928f7ca9cdae (diff) | |
| download | zabbix-d2b78889450f7256e878376e71fe025191060af9.tar.gz zabbix-d2b78889450f7256e878376e71fe025191060af9.tar.xz zabbix-d2b78889450f7256e878376e71fe025191060af9.zip | |
- [DEV-137] fixed DB defining (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5756 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/db.inc.php')
| -rw-r--r-- | frontends/php/include/db.inc.php | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/frontends/php/include/db.inc.php b/frontends/php/include/db.inc.php index ea537418..3b71a16b 100644 --- a/frontends/php/include/db.inc.php +++ b/frontends/php/include/db.inc.php @@ -19,20 +19,20 @@ **/ ?> <?php +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; +} + function DBconnect(&$error){ $result = true; - 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; - } - + global $DB; + $DB['DB'] = null; $DB['TRANSACTIONS'] = 0; @@ -520,6 +520,14 @@ return $result; } +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; +} /* string value prepearing */ if(isset($DB['TYPE']) && $DB['TYPE'] == "ORACLE") { |
