3 function logStart(&$oDB, $sType = '', $sQuery = '', $aLanguageList = array())
5 $aStartTime = explode('.',microtime(true));
6 if (!$aStartTime[1]) $aStartTime[1] = '0';
9 date('Y-m-d H:i:s',$aStartTime[0]).'.'.$aStartTime[1],
10 $_SERVER["REMOTE_ADDR"],
11 $_SERVER['QUERY_STRING'],
16 if ($sType == 'search')
18 $oDB->query('insert into query_log values ('.getDBQuoted($hLog[0]).','.getDBQuoted($hLog[3]).','.getDBQuoted($hLog[1]).')');
21 $sSQL = 'insert into new_query_log (type,starttime,query,ipaddress,useragent,language,format)';
22 $sSQL .= ' values ('.getDBQuoted($sType).','.getDBQuoted($hLog[0]).','.getDBQuoted($hLog[2]);
23 $sSQL .= ','.getDBQuoted($hLog[1]).','.getDBQuoted($_SERVER['HTTP_USER_AGENT']).','.getDBQuoted(join(',',$aLanguageList)).','.getDBQuoted($_GET['format']).')';
30 function logEnd(&$oDB, $hLog, $iNumResults)
32 $aEndTime = explode('.',microtime(true));
33 if (!$aEndTime[1]) $aEndTime[1] = '0';
34 $sEndTime = date('Y-m-d H:i:s',$aEndTime[0]).'.'.$aEndTime[1];
36 $sSQL = 'update query_log set endtime = '.getDBQuoted($sEndTime).', results = '.$iNumResults;
37 $sSQL .= ' where starttime = '.getDBQuoted($hLog[0]);
38 $sSQL .= ' and ipaddress = '.getDBQuoted($hLog[1]);
39 $sSQL .= ' and query = '.getDBQuoted($hLog[3]);
42 $sSQL = 'update new_query_log set endtime = '.getDBQuoted($sEndTime).', results = '.$iNumResults;
43 $sSQL .= ' where starttime = '.getDBQuoted($hLog[0]);
44 $sSQL .= ' and ipaddress = '.getDBQuoted($hLog[1]);
45 $sSQL .= ' and query = '.getDBQuoted($hLog[2]);