From b4bafc76e02d191ddf6a7282fdc073707844fc23 Mon Sep 17 00:00:00 2001 From: Christian Weber Date: Mon, 1 Oct 2007 15:25:40 +0000 Subject: use dbid instead of db name for global table name cache --- it_dbi.class | 8 ++++---- 1 file 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']; -- cgit v1.2.3