summaryrefslogtreecommitdiff
path: root/dbi.class
diff options
context:
space:
mode:
authorNathan Gass2007-02-21 14:57:05 +0000
committerNathan Gass2007-02-21 14:57:05 +0000
commit0a18a2df3f21f99c1e013723c434cfff76b2ab88 (patch)
treec5582f39f1d6808a25d0d712d4978bcb0d5794cd /dbi.class
parentc447d3e31b42f2612a7db46ee723b20ad069f38e (diff)
downloaditools-0a18a2df3f21f99c1e013723c434cfff76b2ab88.tar.gz
itools-0a18a2df3f21f99c1e013723c434cfff76b2ab88.tar.bz2
itools-0a18a2df3f21f99c1e013723c434cfff76b2ab88.zip
implemented config argument home of constructor
Diffstat (limited to 'dbi.class')
-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";