diff options
author | Christian Weber | 2007-09-26 16:20:25 +0000 |
---|---|---|
committer | Christian Weber | 2007-09-26 16:20:25 +0000 |
commit | 936ebf61f5e296c31f7b30fdec1e8b3e74895640 (patch) | |
tree | fd7820b7c079f228b3549e9871c2bab02bab67d1 | |
parent | 38f772d68661d40c976495112344f61d1a89de45 (diff) | |
download | itools-936ebf61f5e296c31f7b30fdec1e8b3e74895640.tar.gz itools-936ebf61f5e296c31f7b30fdec1e8b3e74895640.tar.bz2 itools-936ebf61f5e296c31f7b30fdec1e8b3e74895640.zip |
Make sure singleton exists. new non-table calls store new settings
-rw-r--r-- | it_dbi.class | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/it_dbi.class b/it_dbi.class index 09557de..60619a4 100644 --- a/it_dbi.class +++ b/it_dbi.class @@ -71,6 +71,9 @@ function it_dbi($p = array(), $query = null) if ($p['table']) # Standard use: create a table object { + if (!isset($GLOBALS['it_dbi'])) + new it_dbi; + $this->_p += $this->_get_field_info(); # Get $this->_fields and p[keyfield, autoincrement, randomid] if (is_array($query)) @@ -78,7 +81,7 @@ function it_dbi($p = array(), $query = null) elseif (isset($query)) $this->read($query); } - elseif (!$GLOBALS['it_dbi']) # Special use w/o table: create singleton to store settings + else $GLOBALS['it_dbi'] =& $this; } |