cvs: pear /Log/Log sql.php
| From: | Jon Parise | Date: | Fri, 19 Mar 2004 08:28:42 +0000 |
| Subject: | cvs: pear /Log/Log sql.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-17537@lists.php.net to get a copy of this message | ||
jon Fri Mar 19 03:28:42 2004 EDT
Modified files:
/pear/Log/Log sql.php
Log:
The 'sql' handler now maintains a separate sequence for each log table
within the database. You will need to take appropriate steps to preserve
your sequence numbering if that is important to your site; the ID sequence
will be reinitialized to 0 the first time this updated handler is used.
Submitted by: Rob Lineweaver
http://cvs.php.net/diff.php/pear/Log/Log/sql.php?r1=1.30&r2=1.31&ty=u
Index: pear/Log/Log/sql.php
diff -u pear/Log/Log/sql.php:1.30 pear/Log/Log/sql.php:1.31
--- pear/Log/Log/sql.php:1.30 Fri Mar 19 03:21:22 2004
+++ pear/Log/Log/sql.php Fri Mar 19 03:28:41 2004
@@ -1,9 +1,9 @@
<?php
/**
- * $Header: /repository/pear/Log/Log/sql.php,v 1.30 2004/03/19 08:21:22 jon Exp $
+ * $Header: /repository/pear/Log/Log/sql.php,v 1.31 2004/03/19 08:28:41 jon Exp $
* $Horde: horde/lib/Log/sql.php,v 1.12 2000/08/16 20:27:34 chuck Exp $
*
- * @version $Revision: 1.30 $
+ * @version $Revision: 1.31 $
* @package Log
*/
@@ -178,7 +178,7 @@
$message = $this->_extractMessage($message);
/* Build the SQL query for this log entry insertion. */
- $id = $this->_db->nextId('log_id');
+ $id = $this->_db->nextId(substr($this->_table, 0, 56) . '_id');
$q = sprintf('insert into %s (id, logtime, ident, priority, message)' .
'values(%d, CURRENT_TIMESTAMP, %s, %d, %s)',
$this->_table, $id, $this->_db->quote($this->_ident),