diff options
Diffstat (limited to 'it_dbi.class')
-rw-r--r-- | it_dbi.class | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/it_dbi.class b/it_dbi.class index 5b41f45..d7f7e20 100644 --- a/it_dbi.class +++ b/it_dbi.class @@ -51,8 +51,11 @@ function it_dbi($config = array(), $query = null) if (!is_array($config)) $config = array('table' => $config); + # If global singleton $it_dbi exists, use its defaults (db, user, pw, host) + $defaults = $GLOBALS['it_dbi']->_defaults ? eval("return array({$GLOBALS['it_dbi']->_defaults});") : array(); + # Create current settings - foreach ($config + (array)$GLOBALS['it_dbi_defaultconfig'] + $this->_defaultconfig as $key => $value) + foreach ($config + $defaults + (array)$GLOBALS['it_dbi_defaultconfig'] + $this->_defaultconfig as $key => $value) { $var = "_$key"; $this->$var = $value; |