diff --git a/ChangeLog b/ChangeLog index 1612b4a..80bb8a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,11 @@ --------------------------------------------------------------------------- +Version 2.5.23 (beta), 2008-12-23 +- Fixed typo in textual month detection, which caused date detection + problems in december month only. +- Fixed missing include of debug functions in maintenance.php +- Added some performance tweaks into mysql db driver, which will make + searching for strings within messages faster. +--------------------------------------------------------------------------- Version 2.5.22 (beta), 2008-12-10 - Added workaround for year detection for RFC 3164 like timestamps. This also resolves issues of the syslog date detection on new year. diff --git a/src/classes/logstreamdb.class.php b/src/classes/logstreamdb.class.php index e8bb4be..fda8257 100644 --- a/src/classes/logstreamdb.class.php +++ b/src/classes/logstreamdb.class.php @@ -432,6 +432,10 @@ class LogStreamDB extends LogStream { { global $querycount, $dbmapping; $szTableType = $this->_logStreamConfigObj->DBTableType; + + // Only perform query if row counting is enabled! + if ( strlen($this->_SQLwhereClause) > 0 && !$this->_logStreamConfigObj->DBEnableRowCounting ) + return $this->_firstPageUID; $szSql = "SELECT MAX(" . $dbmapping[$szTableType][SYSLOG_UID] . ") FROM " . $this->_logStreamConfigObj->DBTableName . $this->_SQLwhereClause; $myQuery = mysql_query($szSql, $this->_dbhandle); @@ -461,6 +465,10 @@ class LogStreamDB extends LogStream { global $querycount, $dbmapping; $szTableType = $this->_logStreamConfigObj->DBTableType; + // Only perform query if row counting is enabled! + if ( strlen($this->_SQLwhereClause) > 0 && !$this->_logStreamConfigObj->DBEnableRowCounting ) + return $this->_lastPageUID; + $szSql = "SELECT MIN(" . $dbmapping[$szTableType][SYSLOG_UID] . ") FROM " . $this->_logStreamConfigObj->DBTableName . $this->_SQLwhereClause; $myQuery = mysql_query($szSql, $this->_dbhandle); if ($myQuery) @@ -1097,6 +1105,9 @@ class LogStreamDB extends LogStream { // Append precreated where clause $sqlString .= $this->_SQLwhereClause; + // Output SQL Query into DEBUG +// OutputDebugMessage( "CreateSQLStatement result: " . $sqlString ); + // Append ORDER clause if ( $this->_readDirection == EnumReadDirection::Forward ) $sqlString .= " ORDER BY " . $dbmapping[$szTableType][$szSortColumn]; diff --git a/src/cron/maintenance.php b/src/cron/maintenance.php index 44b0287..8ba593c 100644 --- a/src/cron/maintenance.php +++ b/src/cron/maintenance.php @@ -36,7 +36,8 @@ define('IN_PHPLOGCON', true); $gl_root_path = './../'; // Now include necessary include files! -include($gl_root_path . 'include/functions_common.php'); +include_once($gl_root_path . 'include/functions_common.php'); +include_once($gl_root_path . 'include/functions_debugoutput.php'); // Set commandline mode for the script define('IN_PHPLOGCON_COMMANDLINE', true); diff --git a/src/include/functions_common.php b/src/include/functions_common.php index 8f62aea..68c49d2 100644 --- a/src/include/functions_common.php +++ b/src/include/functions_common.php @@ -521,7 +521,7 @@ function InitRuntimeInformations() global $gl_root_path, $content; // Enable GZIP Compression if enabled! - if (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false && GetConfigSetting("MiscEnableGzipCompression", 1, CFGLEVEL_USER) == 1 ) + if ( isset($_SERVER['HTTP_ACCEPT_ENCODING']) && strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false && GetConfigSetting("MiscEnableGzipCompression", 1, CFGLEVEL_USER) == 1 ) { // This starts gzip compression! ob_start("ob_gzhandler"); @@ -1180,7 +1180,7 @@ function GetMonthFromString($szMonth) return 10; case "Nov": return 11; - case "Dez": + case "Dec": return 12; } }