[geeklog-cvs] geeklog-1.3/system/databases mysql.class.php,1.14,1.14.2.1
dhaun at geeklog.net
dhaun at geeklog.net
Sun Oct 12 04:21:21 EDT 2003
Update of /usr/cvs/geeklog/geeklog-1.3/system/databases
In directory geeklog_prod:/tmp/cvs-serv13465
Modified Files:
Tag: geeklog_1_3_8_1_1
mysql.class.php
Log Message:
Don't display the details of an SQL error any more (still available from error.log). Can be switched back on with setDisplayError(true);
Index: mysql.class.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/system/databases/mysql.class.php,v
retrieving revision 1.14
retrieving revision 1.14.2.1
diff -C2 -d -r1.14 -r1.14.2.1
*** mysql.class.php 21 Jan 2003 03:34:02 -0000 1.14
--- mysql.class.php 12 Oct 2003 08:21:19 -0000 1.14.2.1
***************
*** 33,40 ****
/**
! * This file is the mysql implementation of the Geeklog abstraction layer. Unfortunately
! * the Geeklog abstraction layer isn't 100% abstract because a key few functions use
! * MySQL's REPLACE INTO syntax which is not a SQL standard. Those issue will be resolved
! * in the near future
*
*/
--- 33,40 ----
/**
! * This file is the mysql implementation of the Geeklog abstraction layer.
! * Unfortunately the Geeklog abstraction layer isn't 100% abstract because a few
! * key functions use MySQL's REPLACE INTO syntax which is not a SQL standard.
! * This issue will need to be resolved some time ...
*
*/
***************
*** 66,69 ****
--- 66,73 ----
* @access private
*/
+ var $_display_error = false;
+ /**
+ * @access private
+ */
var $_errorlog_fn = '';
***************
*** 162,165 ****
--- 166,185 ----
/**
+ * Turns detailed error reporting on
+ *
+ * If set to true, this will display detailed error messages on the site.
+ * Otherwise, it will only that state an error occured without going into
+ * details. The complete error message (including the offending SQL request)
+ * is always available from error.log.
+ *
+ * @param boolean $flag true or false
+ *
+ */
+ function setDisplayError($flag)
+ {
+ $this->_display_error = $flag;
+ }
+
+ /**
* Checks to see if debug mode is on
*
***************
*** 639,644 ****
{
if (mysql_errno()) {
! $this->_errorlog(@mysql_errno() . ': ' . @mysql_error() . " SQL in question: $sql");
! return @mysql_errno() . ': ' . @mysql_error();
}
--- 659,668 ----
{
if (mysql_errno()) {
! $this->_errorlog(@mysql_errno() . ': ' . @mysql_error() . ". SQL in question: $sql");
! if ($this->_display_error) {
! return @mysql_errno() . ': ' . @mysql_error();
! } else {
! return 'An SQL error has occured. Please see error.log for details.';
! }
}
More information about the geeklog-cvs
mailing list