summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dbi.class5
1 files changed, 4 insertions, 1 deletions
diff --git a/dbi.class b/dbi.class
index c6469fe..961cd8f 100644
--- a/dbi.class
+++ b/dbi.class
@@ -59,7 +59,10 @@ function it_dbi($config, $query = null)
unset($this->_defaultconfig); /* to shorten print_r() output */
if (!isset($this->_db))
- $this->_db = $GLOBALS['ULTRADB'];
+ if($config['home'] && ($site = it::match( "/www/([^/]+)", $config['home'])))
+ $this->_db = strtr( $site, ".-", "__" );
+ else
+ $this->_db = $GLOBALS['ULTRADB'];
$dbid = "$this->_db/$this->_server/$this->_user";