diff options
author | Urban Müller | 2007-07-23 14:01:18 +0000 |
---|---|---|
committer | Urban Müller | 2007-07-23 14:01:18 +0000 |
commit | 3c49574fa3d3a946f975da4a8574dc67d37c8c2c (patch) | |
tree | 0a573de8a55840ce491ba822322fffc648a14ec7 | |
parent | e604ad4231a127ae417dc7bfcf300af3ca69a016 (diff) | |
download | itools-3c49574fa3d3a946f975da4a8574dc67d37c8c2c.tar.gz itools-3c49574fa3d3a946f975da4a8574dc67d37c8c2c.tar.bz2 itools-3c49574fa3d3a946f975da4a8574dc67d37c8c2c.zip |
_defaults are needed for autoloader
-rw-r--r-- | dbi.class | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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)) |