summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Weber2007-10-01 15:25:40 +0000
committerChristian Weber2007-10-01 15:25:40 +0000
commitb4bafc76e02d191ddf6a7282fdc073707844fc23 (patch)
tree00cfa4f92553e59d185391950cf10566288c6bda
parent77300bbcab173f3187b6ea1bbe8be7150c2288f8 (diff)
downloaditools-b4bafc76e02d191ddf6a7282fdc073707844fc23.tar.gz
itools-b4bafc76e02d191ddf6a7282fdc073707844fc23.tar.bz2
itools-b4bafc76e02d191ddf6a7282fdc073707844fc23.zip
use dbid instead of db name for global table name cache
-rw-r--r--it_dbi.class8
1 files changed, 4 insertions, 4 deletions
diff --git a/it_dbi.class b/it_dbi.class
index 9207b63..178a9d4 100644
--- a/it_dbi.class
+++ b/it_dbi.class
@@ -118,15 +118,15 @@ function createclass($p)
# Make sure singleton exists
$dbi = $GLOBALS['it_dbi'] ? $GLOBALS['it_dbi'] : new it_dbi(array('table' => null) + $p);
- $db = $dbi->_p['db'];
+ $dbid = "{$dbi->_p['user']}@{$dbi->_p['server']}:{$dbi->_p['db']}";
- if (!isset($dbi->_tables[$db]))
+ if (!isset($dbi->_tables[$dbid]))
{
for ($res = $dbi->query('SHOW TABLES'); $row = mysql_fetch_row($res);)
- $dbi->_tables[$db][] = $row[0];
+ $dbi->_tables[$dbid][] = $row[0];
}
- if (in_array($p['table'], $dbi->_tables[$db])) # Do not generate classes for non-existant tables
+ if (in_array($p['table'], $dbi->_tables[$dbid])) # Do not generate classes for non-existant tables
{
$classname = $p['classprefix'] . $p['table'];