From: skodak Date: Fri, 2 May 2008 22:50:22 +0000 (+0000) Subject: MDL-14672 adodb PHP5 only version V5.04a import - yay! X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=ef85daa2b79252b82365a0637974e7fcc59531ef;p=moodle.git MDL-14672 adodb PHP5 only version V5.04a import - yay! --- diff --git a/lib/adodb/adodb-active-record.inc.php b/lib/adodb/adodb-active-record.inc.php index 0654828c00..328eaa8b63 100644 --- a/lib/adodb/adodb-active-record.inc.php +++ b/lib/adodb/adodb-active-record.inc.php @@ -1,7 +1,7 @@ db =& $db; + $obj->db = $db; $obj->tables = array(); $_ADODB_ACTIVE_DBS[] = $obj; @@ -71,8 +71,7 @@ class ADODB_Active_Record { var $_lasterr = false; // last error message var $_original = false; // the original values loaded or inserted, refreshed on update - // should be static - function UseDefaultValues($bool=null) + static function UseDefaultValues($bool=null) { global $ADODB_ACTIVE_DEFVALS; if (isset($bool)) $ADODB_ACTIVE_DEFVALS = $bool; @@ -80,15 +79,16 @@ class ADODB_Active_Record { } // should be static - function SetDatabaseAdapter(&$db) + static function SetDatabaseAdapter(&$db) { return ADODB_SetDatabaseAdapter($db); } - // php4 constructor - function ADODB_Active_Record($table = false, $pkeyarr=false, $db=false) + + public function __set($name, $value) { - ADODB_Active_Record::__construct($table,$pkeyarr,$db); + $name = str_replace(' ', '_', $name); + $this->$name = $value; } // php5 constructor @@ -153,23 +153,24 @@ class ADODB_Active_Record { global $ADODB_ASSOC_CASE,$_ADODB_ACTIVE_DBS , $ADODB_CACHE_DIR, $ADODB_ACTIVE_CACHESECS; global $ADODB_ACTIVE_DEFVALS; - $activedb =& $_ADODB_ACTIVE_DBS[$this->_dbat]; + $activedb = $_ADODB_ACTIVE_DBS[$this->_dbat]; $table = $this->_table; $tables = $activedb->tables; $tableat = $this->_tableat; if (!$forceUpdate && !empty($tables[$tableat])) { - $tobj =& $tables[$tableat]; + + $tobj = $tables[$tableat]; foreach($tobj->flds as $name => $fld) { - if ($ADODB_ACTIVE_DEFVALS && isset($fld->default_value)) - $this->$name = $fld->default_value; - else - $this->$name = null; + if ($ADODB_ACTIVE_DEFVALS && isset($fld->default_value)) + $this->$name = $fld->default_value; + else + $this->$name = null; } return; } - $db =& $activedb->db; + $db = $activedb->db; $fname = $ADODB_CACHE_DIR . '/adodb_' . $db->databaseType . '_active_'. $table . '.cache'; if (!$forceUpdate && $ADODB_ACTIVE_CACHESECS && $ADODB_CACHE_DIR && file_exists($fname)) { $fp = fopen($fname,'r'); @@ -288,7 +289,7 @@ class ADODB_Active_Record { if ($this->_dbat < 0) $db = false; else { $activedb = $_ADODB_ACTIVE_DBS[$this->_dbat]; - $db =& $activedb->db; + $db = $activedb->db; } if (function_exists('adodb_throw')) { @@ -322,7 +323,7 @@ class ADODB_Active_Record { // retrieve ADOConnection from _ADODB_Active_DBs - function &DB() + function DB() { global $_ADODB_ACTIVE_DBS; @@ -332,17 +333,17 @@ class ADODB_Active_Record { return $false; } $activedb = $_ADODB_ACTIVE_DBS[$this->_dbat]; - $db =& $activedb->db; + $db = $activedb->db; return $db; } // retrieve ADODB_Active_Table - function &TableInfo() + function TableInfo() { global $_ADODB_ACTIVE_DBS; $activedb = $_ADODB_ACTIVE_DBS[$this->_dbat]; - $table =& $activedb->tables[$this->_tableat]; + $table = $activedb->tables[$this->_tableat]; return $table; } @@ -351,7 +352,7 @@ class ADODB_Active_Record { { global $ACTIVE_RECORD_SAFETY; - $db =& $this->DB(); + $db = $this->DB(); if (!$row) { $this->_saved = false; @@ -360,8 +361,9 @@ class ADODB_Active_Record { $this->_saved = true; - $table =& $this->TableInfo(); + $table = $this->TableInfo(); if ($ACTIVE_RECORD_SAFETY && sizeof($table->flds) != sizeof($row)) { + # $bad_size = TRUE; if (sizeof($row) == 2 * sizeof($table->flds)) { // Only keep string keys @@ -370,13 +372,14 @@ class ADODB_Active_Record { $bad_size = FALSE; } if ($bad_size) { - $this->Error("Table structure of $this->_table has changed","Load"); - return false; - } + $this->Error("Table structure of $this->_table has changed","Load"); + return false; + } + # } else - $keys = array_keys($row); - + $keys = array_keys($row); + # reset($keys); $this->_original = array(); foreach($table->flds as $name=>$fld) { @@ -446,7 +449,7 @@ class ADODB_Active_Record { function Load($where,$bindarr=false) { - $db =& $this->DB(); if (!$db) return false; + $db = $this->DB(); if (!$db) return false; $this->_where = $where; $save = $db->SetFetchMode(ADODB_FETCH_NUM); @@ -468,9 +471,9 @@ class ADODB_Active_Record { // false on error function Insert() { - $db =& $this->DB(); if (!$db) return false; + $db = $this->DB(); if (!$db) return false; $cnt = 0; - $table =& $this->TableInfo(); + $table = $this->TableInfo(); $valarr = array(); $names = array(); @@ -518,8 +521,8 @@ class ADODB_Active_Record { function Delete() { - $db =& $this->DB(); if (!$db) return false; - $table =& $this->TableInfo(); + $db = $this->DB(); if (!$db) return false; + $table = $this->TableInfo(); $where = $this->GenWhere($db,$table); $sql = 'DELETE FROM '.$this->_table.' WHERE '.$where; @@ -529,10 +532,10 @@ class ADODB_Active_Record { } // returns an array of active record objects - function &Find($whereOrderBy,$bindarr=false,$pkeysArr=false) + function Find($whereOrderBy,$bindarr=false,$pkeysArr=false) { - $db =& $this->DB(); if (!$db || empty($this->_table)) return false; - $arr =& $db->GetActiveRecordsClass(get_class($this),$this->_table, $whereOrderBy,$bindarr,$pkeysArr); + $db = $this->DB(); if (!$db || empty($this->_table)) return false; + $arr = $db->GetActiveRecordsClass(get_class($this),$this->_table, $whereOrderBy,$bindarr,$pkeysArr); return $arr; } @@ -541,8 +544,8 @@ class ADODB_Active_Record { { global $ADODB_ASSOC_CASE; - $db =& $this->DB(); if (!$db) return false; - $table =& $this->TableInfo(); + $db = $this->DB(); if (!$db) return false; + $table = $this->TableInfo(); $pkey = $table->keys; @@ -593,7 +596,7 @@ class ADODB_Active_Record { } } - $this->_original =& $valarr; + $this->_original = $valarr; } return $ok; } @@ -601,8 +604,8 @@ class ADODB_Active_Record { // returns 0 on error, 1 on update, -1 if no change in data (no update) function Update() { - $db =& $this->DB(); if (!$db) return false; - $table =& $this->TableInfo(); + $db = $this->DB(); if (!$db) return false; + $table = $this->TableInfo(); $where = $this->GenWhere($db, $table); @@ -647,7 +650,7 @@ class ADODB_Active_Record { $sql = 'UPDATE '.$this->_table." SET ".implode(",",$pairs)." WHERE ".$where; $ok = $db->Execute($sql,$valarr); if ($ok) { - $this->_original =& $neworig; + $this->_original = $neworig; return 1; } return 0; @@ -655,7 +658,7 @@ class ADODB_Active_Record { function GetAttributeNames() { - $table =& $this->TableInfo(); + $table = $this->TableInfo(); if (!$table) return false; return array_keys($table->flds); } diff --git a/lib/adodb/adodb-csvlib.inc.php b/lib/adodb/adodb-csvlib.inc.php index c82c965582..2872f2042d 100644 --- a/lib/adodb/adodb-csvlib.inc.php +++ b/lib/adodb/adodb-csvlib.inc.php @@ -8,7 +8,7 @@ $ADODB_INCLUDED_CSV = 1; /* - V4.98 13 Feb 2008 (c) 2000-2008 John Lim (jlim#natsoft.com.my). All rights reserved. + V5.04a 25 Mar 2008 (c) 2000-2008 John Lim (jlim#natsoft.com.my). All rights reserved. Released under both BSD license and Lesser GPL library license. Whenever there is any discrepancy between the two licenses, the BSD license will take precedence. See License.txt. @@ -54,7 +54,7 @@ $ADODB_INCLUDED_CSV = 1; $line = "====1,$tt,$sql\n"; if ($rs->databaseType == 'array') { - $rows =& $rs->_array; + $rows = $rs->_array; } else { $rows = array(); while (!$rs->EOF) { @@ -64,7 +64,7 @@ $ADODB_INCLUDED_CSV = 1; } for($i=0; $i < $max; $i++) { - $o =& $rs->FetchField($i); + $o = $rs->FetchField($i); $flds[] = $o; } @@ -90,7 +90,7 @@ $ADODB_INCLUDED_CSV = 1; * error occurred in sql INSERT/UPDATE/DELETE, * empty recordset is returned */ - function &csv2rs($url,&$err,$timeout=0, $rsclass='ADORecordSet_array') + function csv2rs($url,&$err,$timeout=0, $rsclass='ADORecordSet_array') { $false = false; $err = false; diff --git a/lib/adodb/adodb-datadict.inc.php b/lib/adodb/adodb-datadict.inc.php index 86961a2bfc..d98d551154 100644 --- a/lib/adodb/adodb-datadict.inc.php +++ b/lib/adodb/adodb-datadict.inc.php @@ -1,7 +1,7 @@ connection->MetaIndexes($this->TableName($table), $primary, $owner); } - function MetaType($t,$len=-1,$fieldobj=false) { static $typeMap = array( @@ -369,7 +368,7 @@ class ADODB_DataDict { function ExecuteSQLArray($sql, $continueOnError = true) { $rez = 2; - $conn = &$this->connection; + $conn = $this->connection; $saved = $conn->debug; foreach($sql as $line) { diff --git a/lib/adodb/adodb-error.inc.php b/lib/adodb/adodb-error.inc.php index f55516116b..72779ab2cb 100644 --- a/lib/adodb/adodb-error.inc.php +++ b/lib/adodb/adodb-error.inc.php @@ -1,6 +1,6 @@ rs = $rs; - } - function rewind() - { - $this->rs->MoveFirst(); - } - - function valid() - { - return !$this->rs->EOF; - } - - function key() - { - return $this->rs->_currentRow; - } - function current() - { - return $this->rs->fields; - } - function next() - { - $this->rs->MoveNext(); - } - - function __call($func, $params) - { - return call_user_func_array(array($this->rs, $func), $params); - } - - - function hasMore() - { - return !$this->rs->EOF; - } - -} + Moved to adodb.inc.php to improve performance. + */ + -class ADODB_BASE_RS implements IteratorAggregate { - function getIterator() { - return new ADODB_Iterator($this); - } - - /* this is experimental - i don't really know what to return... */ - function __toString() - { - include_once(ADODB_DIR.'/toexport.inc.php'); - return _adodb_export($this,',',',',false,true); - } -} ?> \ No newline at end of file diff --git a/lib/adodb/adodb-lib.inc.php b/lib/adodb/adodb-lib.inc.php index 1e1e7e3d5d..899972ea20 100644 --- a/lib/adodb/adodb-lib.inc.php +++ b/lib/adodb/adodb-lib.inc.php @@ -1,5 +1,8 @@ databaseType,'postgres',8) == 0 || strncmp($zthis->databaseType,'mysql',5) == 0) { $rewritesql = "SELECT COUNT(*) FROM ($rewritesql) _ADODB_ALIAS_"; } else { - $rewritesql = "SELECT COUNT(*) FROM ($rewritesql) "; + $rewritesql = "SELECT COUNT(*) FROM ($rewritesql)"; } - } else { + } else { // now replace SELECT ... FROM with SELECT COUNT(*) FROM $rewritesql = preg_replace( '/^\s*SELECT\s.*\s+FROM\s/Uis','SELECT COUNT(*) FROM ',$sql); @@ -431,7 +434,7 @@ function _adodb_getcount(&$zthis, $sql,$inputarr=false,$secs2cache=0) if (isset($rewritesql) && $rewritesql != $sql) { if (preg_match('/\sLIMIT\s+[0-9]+/i',$sql,$limitarr)) $rewritesql .= $limitarr[0]; - + if ($secs2cache) { // we only use half the time of secs2cache because the count can quickly // become inaccurate if new records are added @@ -452,7 +455,7 @@ function _adodb_getcount(&$zthis, $sql,$inputarr=false,$secs2cache=0) if (preg_match('/\sLIMIT\s+[0-9]+/i',$sql,$limitarr)) $rewritesql .= $limitarr[0]; - $rstest = &$zthis->Execute($rewritesql,$inputarr); + $rstest = $zthis->Execute($rewritesql,$inputarr); if (!$rstest) $rstest = $zthis->Execute($sql,$inputarr); if ($rstest) { @@ -486,7 +489,7 @@ function _adodb_getcount(&$zthis, $sql,$inputarr=false,$secs2cache=0) data will get out of synch. use CachePageExecute() only with tables that rarely change. */ -function &_adodb_pageexecute_all_rows(&$zthis, $sql, $nrows, $page, +function _adodb_pageexecute_all_rows(&$zthis, $sql, $nrows, $page, $inputarr=false, $secs2cache=0) { $atfirstpage = false; @@ -522,9 +525,9 @@ function &_adodb_pageexecute_all_rows(&$zthis, $sql, $nrows, $page, // We get the data we want $offset = $nrows * ($page-1); if ($secs2cache > 0) - $rsreturn = &$zthis->CacheSelectLimit($secs2cache, $sql, $nrows, $offset, $inputarr); + $rsreturn = $zthis->CacheSelectLimit($secs2cache, $sql, $nrows, $offset, $inputarr); else - $rsreturn = &$zthis->SelectLimit($sql, $nrows, $offset, $inputarr, $secs2cache); + $rsreturn = $zthis->SelectLimit($sql, $nrows, $offset, $inputarr, $secs2cache); // Before returning the RecordSet, we set the pagination properties we need @@ -539,8 +542,8 @@ function &_adodb_pageexecute_all_rows(&$zthis, $sql, $nrows, $page, return $rsreturn; } -// Iván Oliva version -function &_adodb_pageexecute_no_last_page(&$zthis, $sql, $nrows, $page, $inputarr=false, $secs2cache=0) +// Iv�n Oliva version +function _adodb_pageexecute_no_last_page(&$zthis, $sql, $nrows, $page, $inputarr=false, $secs2cache=0) { $atfirstpage = false; @@ -556,16 +559,16 @@ function &_adodb_pageexecute_no_last_page(&$zthis, $sql, $nrows, $page, $inputar // the last page number. $pagecounter = $page + 1; $pagecounteroffset = ($pagecounter * $nrows) - $nrows; - if ($secs2cache>0) $rstest = &$zthis->CacheSelectLimit($secs2cache, $sql, $nrows, $pagecounteroffset, $inputarr); - else $rstest = &$zthis->SelectLimit($sql, $nrows, $pagecounteroffset, $inputarr, $secs2cache); + if ($secs2cache>0) $rstest = $zthis->CacheSelectLimit($secs2cache, $sql, $nrows, $pagecounteroffset, $inputarr); + else $rstest = $zthis->SelectLimit($sql, $nrows, $pagecounteroffset, $inputarr, $secs2cache); if ($rstest) { while ($rstest && $rstest->EOF && $pagecounter>0) { $atlastpage = true; $pagecounter--; $pagecounteroffset = $nrows * ($pagecounter - 1); $rstest->Close(); - if ($secs2cache>0) $rstest = &$zthis->CacheSelectLimit($secs2cache, $sql, $nrows, $pagecounteroffset, $inputarr); - else $rstest = &$zthis->SelectLimit($sql, $nrows, $pagecounteroffset, $inputarr, $secs2cache); + if ($secs2cache>0) $rstest = $zthis->CacheSelectLimit($secs2cache, $sql, $nrows, $pagecounteroffset, $inputarr); + else $rstest = $zthis->SelectLimit($sql, $nrows, $pagecounteroffset, $inputarr, $secs2cache); } if ($rstest) $rstest->Close(); } @@ -577,8 +580,8 @@ function &_adodb_pageexecute_no_last_page(&$zthis, $sql, $nrows, $page, $inputar // We get the data we want $offset = $nrows * ($page-1); - if ($secs2cache > 0) $rsreturn = &$zthis->CacheSelectLimit($secs2cache, $sql, $nrows, $offset, $inputarr); - else $rsreturn = &$zthis->SelectLimit($sql, $nrows, $offset, $inputarr, $secs2cache); + if ($secs2cache > 0) $rsreturn = $zthis->CacheSelectLimit($secs2cache, $sql, $nrows, $offset, $inputarr); + else $rsreturn = $zthis->SelectLimit($sql, $nrows, $offset, $inputarr, $secs2cache); // Before returning the RecordSet, we set the pagination properties we need if ($rsreturn) { @@ -773,10 +776,10 @@ static $cacheCols; //php can't do a $rsclass::MetaType() $rsclass = $zthis->rsPrefix.$zthis->databaseType; $recordSet = new $rsclass(-1,$zthis->fetchMode); - $recordSet->connection = &$zthis; + $recordSet->connection = $zthis; if (is_string($cacheRS) && $cacheRS == $rs) { - $columns =& $cacheCols; + $columns = $cacheCols; } else { $columns = $zthis->MetaColumns( $tableName ); $cacheRS = $tableName; @@ -784,7 +787,7 @@ static $cacheCols; } } else if (is_subclass_of($rs, 'adorecordset')) { if (isset($rs->insertSig) && is_integer($cacheRS) && $cacheRS == $rs->insertSig) { - $columns =& $cacheCols; + $columns = $cacheCols; } else { for ($i=0, $max=$rs->FieldCount(); $i < $max; $i++) $columns[] = $rs->FetchField($i); @@ -792,7 +795,7 @@ static $cacheCols; $cacheCols = $columns; $rs->insertSig = $cacheSig++; } - $recordSet =& $rs; + $recordSet = $rs; } else { printf(ADODB_BAD_RS,'GetInsertSQL'); @@ -993,7 +996,7 @@ function _adodb_column_sql(&$zthis, $action, $type, $fname, $fnameq, $arrFields, case "D": $val = $zthis->DBDate($arrFields[$fname]); break; - + case "T": $val = $zthis->DBTimeStamp($arrFields[$fname]); break; @@ -1002,7 +1005,7 @@ function _adodb_column_sql(&$zthis, $action, $type, $fname, $fnameq, $arrFields, case "N": $val = $arrFields[$fname]; if (!is_numeric($val)) $val = str_replace(',', '.', (float)$val); - break; + break; case "L": //Integer field suitable for storing booleans (0 or 1) // Moodle added case "I": @@ -1178,4 +1181,4 @@ function _adodb_find_from($sql) } */ -?> +?> \ No newline at end of file diff --git a/lib/adodb/adodb-memcache.lib.inc.php b/lib/adodb/adodb-memcache.lib.inc.php index 31a1c247f3..a4b7e7531c 100644 --- a/lib/adodb/adodb-memcache.lib.inc.php +++ b/lib/adodb/adodb-memcache.lib.inc.php @@ -18,7 +18,7 @@ $ADODB_INCLUDED_MEMCACHE = 1; */ - function &getmemcache($key,&$err, $timeout=0, $host, $port) + function getmemcache($key,&$err, $timeout=0, $host, $port) { $false = false; $err = false; diff --git a/lib/adodb/adodb-pager.inc.php b/lib/adodb/adodb-pager.inc.php index fe6bab543c..16acee365f 100644 --- a/lib/adodb/adodb-pager.inc.php +++ b/lib/adodb/adodb-pager.inc.php @@ -1,7 +1,7 @@ db->pageExecuteCountRows) $ADODB_COUNTRECS = true; if ($this->cache) - $rs = &$this->db->CachePageExecute($this->cache,$this->sql,$rows,$this->curr_page); + $rs = $this->db->CachePageExecute($this->cache,$this->sql,$rows,$this->curr_page); else - $rs = &$this->db->PageExecute($this->sql,$rows,$this->curr_page); + $rs = $this->db->PageExecute($this->sql,$rows,$this->curr_page); $ADODB_COUNTRECS = $savec; - $this->rs = &$rs; + $this->rs = $rs; if (!$rs) { print "

Query failed: $this->sql

"; return; diff --git a/lib/adodb/adodb-pear.inc.php b/lib/adodb/adodb-pear.inc.php index cfdc2f8a98..60696c5cca 100644 --- a/lib/adodb/adodb-pear.inc.php +++ b/lib/adodb/adodb-pear.inc.php @@ -1,6 +1,6 @@ = minimum number of secs to run -define( 'ADODB_OPT_HIGH', 2); -define( 'ADODB_OPT_LOW', 1); // returns in K the memory of current process, or 0 if not known function adodb_getmem() @@ -65,25 +66,25 @@ function adodb_microtime() } /* sql code timing */ -function& adodb_log_sql(&$connx,$sql,$inputarr) +function adodb_log_sql(&$connx,$sql,$inputarr) { $perf_table = adodb_perf::table(); $connx->fnExecute = false; $t0 = microtime(); - $rs =& $connx->Execute($sql,$inputarr); + $rs = $connx->Execute($sql,$inputarr); $t1 = microtime(); if (!empty($connx->_logsql) && (empty($connx->_logsqlErrors) || !$rs)) { global $ADODB_LOG_CONN; if (!empty($ADODB_LOG_CONN)) { - $conn = &$ADODB_LOG_CONN; + $conn = $ADODB_LOG_CONN; if ($conn->databaseType != $connx->databaseType) $prefix = '/*dbx='.$connx->databaseType .'*/ '; else $prefix = ''; } else { - $conn =& $connx; + $conn = $connx; $prefix = ''; } @@ -168,12 +169,13 @@ function& adodb_log_sql(&$connx,$sql,$inputarr) if ($dbT == 'db2') $arr['f'] = (float) $arr['f']; $isql = "insert into $perf_table (created,sql0,sql1,params,tracer,timer) values( $d,?,?,?,?,?)"; } + global $ADODB_PERF_MIN; if ($errN != 0 || $time >= $ADODB_PERF_MIN) { $ok = $conn->Execute($isql,$arr); - } else { + } else $ok = true; - } + $conn->debug = $saved; if ($ok) { @@ -181,7 +183,7 @@ function& adodb_log_sql(&$connx,$sql,$inputarr) } else { $err2 = $conn->ErrorMsg(); $conn->_logsql = true; // enable logsql error simulation - $perf =& NewPerfMonitor($conn); + $perf = NewPerfMonitor($conn); if ($perf) { if ($perf->CreateLogTable()) $ok = $conn->Execute($isql,$arr); } else { @@ -235,7 +237,7 @@ class adodb_perf { var $maxLength = 2000; // Sets the tablename to be used - function table($newtable = false) + static function table($newtable = false) { static $_table; @@ -416,7 +418,7 @@ Committed_AS: 348732 kB $saveE = $this->conn->fnExecute; $this->conn->fnExecute = false; $perf_table = adodb_perf::table(); - $rs =& $this->conn->SelectLimit("select distinct count(*),sql1,tracer as error_msg from $perf_table where tracer like 'ERROR:%' group by sql1,tracer order by 1 desc",$numsql);//,$numsql); + $rs = $this->conn->SelectLimit("select distinct count(*),sql1,tracer as error_msg from $perf_table where tracer like 'ERROR:%' group by sql1,tracer order by 1 desc",$numsql);//,$numsql); $this->conn->fnExecute = $saveE; if ($rs) { $s .= rs2html($rs,false,false,false,false); @@ -450,7 +452,7 @@ Committed_AS: 348732 kB $ADODB_FETCH_MODE = ADODB_FETCH_NUM; if ($this->conn->fetchMode !== false) $savem = $this->conn->SetFetchMode(false); //$this->conn->debug=1; - $rs =& $this->conn->SelectLimit( + $rs = $this->conn->SelectLimit( "select avg(timer) as avg_timer,$sql1,count(*),max(timer) as max_timer,min(timer) as min_timer from $perf_table where {$this->conn->upperCase}({$this->conn->substr}(sql0,1,5)) not in ('DROP ','INSER','COMMI','CREAT') @@ -529,7 +531,7 @@ Committed_AS: 348732 kB $ADODB_FETCH_MODE = ADODB_FETCH_NUM; if ($this->conn->fetchMode !== false) $savem = $this->conn->SetFetchMode(false); - $rs =& $this->conn->SelectLimit( + $rs = $this->conn->SelectLimit( "select sum(timer) as total,$sql1,count(*),max(timer) as max_timer,min(timer) as min_timer from $perf_table where {$this->conn->upperCase}({$this->conn->substr}(sql0,1,5)) not in ('DROP ','INSER','COMMI','CREAT') @@ -578,7 +580,7 @@ Committed_AS: 348732 kB /* Raw function returning array of poll paramters */ - function &PollParameters() + function PollParameters() { $arr[0] = (float)$this->DBParameter('data cache hit ratio'); $arr[1] = (float)$this->DBParameter('data reads'); @@ -653,11 +655,10 @@ Committed_AS: 348732 kB $perf_table = adodb_perf::table(); $this->conn->Execute("delete from $perf_table where created<".$this->conn->sysTimeStamp); } - /***********************************************************************************************/ // HIGH LEVEL UI FUNCTIONS /***********************************************************************************************/ - + function UI($pollsecs=5) { @@ -719,13 +720,11 @@ Committed_AS: 348732 kB switch ($do) { default: case 'stats': - if (empty($ADODB_LOG_CONN)) echo "

  Clear SQL Log
"; echo $this->HealthCheck(); //$this->conn->debug=1; - echo $this->CheckMemory(); - global $ADODB_LOG_CONN; + echo $this->CheckMemory(); break; case 'poll': echo "