--- a/web/lib/Zend/Log/Writer/Db.php Thu Mar 21 17:31:31 2013 +0100
+++ b/web/lib/Zend/Log/Writer/Db.php Thu Mar 21 19:50:53 2013 +0100
@@ -15,9 +15,9 @@
* @category Zend
* @package Zend_Log
* @subpackage Writer
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Db.php 22513 2010-07-01 13:48:39Z ramon $
+ * @version $Id: Db.php 25247 2013-02-01 17:49:40Z frosch $
*/
/** Zend_Log_Writer_Abstract */
@@ -27,30 +27,32 @@
* @category Zend
* @package Zend_Log
* @subpackage Writer
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Db.php 22513 2010-07-01 13:48:39Z ramon $
+ * @version $Id: Db.php 25247 2013-02-01 17:49:40Z frosch $
*/
class Zend_Log_Writer_Db extends Zend_Log_Writer_Abstract
{
/**
* Database adapter instance
+ *
* @var Zend_Db_Adapter
*/
- private $_db;
+ protected $_db;
/**
* Name of the log table in the database
+ *
* @var string
*/
- private $_table;
+ protected $_table;
/**
* Relates database columns names to log data field keys.
*
* @var null|array
*/
- private $_columnMap;
+ protected $_columnMap;
/**
* Class constructor
@@ -58,6 +60,7 @@
* @param Zend_Db_Adapter $db Database adapter instance
* @param string $table Log table in database
* @param array $columnMap
+ * @return void
*/
public function __construct($db, $table, $columnMap = null)
{
@@ -71,7 +74,6 @@
*
* @param array|Zend_Config $config
* @return Zend_Log_Writer_Db
- * @throws Zend_Log_Exception
*/
static public function factory($config)
{
@@ -95,6 +97,9 @@
/**
* Formatting is not possible on this writer
+ *
+ * @return void
+ * @throws Zend_Log_Exception
*/
public function setFormatter(Zend_Log_Formatter_Interface $formatter)
{
@@ -117,6 +122,7 @@
*
* @param array $event event data
* @return void
+ * @throws Zend_Log_Exception
*/
protected function _write($event)
{
@@ -130,7 +136,9 @@
} else {
$dataToInsert = array();
foreach ($this->_columnMap as $columnName => $fieldKey) {
- $dataToInsert[$columnName] = $event[$fieldKey];
+ if (isset($event[$fieldKey])) {
+ $dataToInsert[$columnName] = $event[$fieldKey];
+ }
}
}