summaryrefslogtreecommitdiff
path: root/dbi.class
diff options
context:
space:
mode:
authorUrban Müller2007-07-23 14:01:18 +0000
committerUrban Müller2007-07-23 14:01:18 +0000
commit3c49574fa3d3a946f975da4a8574dc67d37c8c2c (patch)
tree0a573de8a55840ce491ba822322fffc648a14ec7 /dbi.class
parente604ad4231a127ae417dc7bfcf300af3ca69a016 (diff)
downloaditools-3c49574fa3d3a946f975da4a8574dc67d37c8c2c.tar.gz
itools-3c49574fa3d3a946f975da4a8574dc67d37c8c2c.tar.bz2
itools-3c49574fa3d3a946f975da4a8574dc67d37c8c2c.zip
_defaults are needed for autoloader
Diffstat (limited to 'dbi.class')
-rw-r--r--dbi.class12
1 files changed, 6 insertions, 6 deletions
diff --git a/dbi.class b/dbi.class
index 9426971..5666d28 100644
--- a/dbi.class
+++ b/dbi.class
@@ -67,6 +67,11 @@ function it_dbi($config = array(), $query = null)
$this->_dbid = "$this->_db/$this->_server/$this->_user";
+ $this->_defaults = "";
+ foreach($config as $key => $value)
+ if ($key != 'createclasses')
+ $this->_defaults .= "'$key' => '".strtr($value, array('\'' => '\\\'', '$' => '\\$'))."', ";
+
if ($this->_createclasses)
{
$this->_connect();
@@ -74,16 +79,11 @@ function it_dbi($config = array(), $query = null)
if (!($tables = mysql_list_tables($this->_db, $this->_link)))
$this->_fatal("it_dbi(): can't list on tables \"$this->_db\": " . mysql_error($this->_link));
- $this->_defaults = "";
- foreach($config as $key => $value)
- if ($key != 'createclasses')
- $this->_defaults .= "'$key' => '".strtr($value, array('\'' => '\\\'', '$' => '\\$'))."', ";
-
for ($i = 0; $i < mysql_num_rows($tables); $i++)
$this->createclass(mysql_tablename($tables, $i));
}
- if (!$GLOBALS['it_dbi'])
+ if (!$GLOBALS['it_dbi'] && !$config['table'])
$GLOBALS['it_dbi'] =& $this;
if (isset($query))