PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Logging » Log » Bug #5777

Log 1.9.1 Call to undefined method Log_sql::_sql()

Details

Submitted2005-10-25 10:11 UTC
Fromnick dot locking at gmail dot com
Assignedjon
StatusClosed
PackageLog
PHP Version5.0.5
OSTrustix 2.2
Roadmaps(Not assigned)

Comments

[2005-10-25 10:11 UTC] nick dot locking at gmail dot com

Description:
------------
Looks like the new version that fixes the SQL connection re-use bug has another bug - seems to error fairly fatally on startup, possibly because I'm not providing custom SQL?

Test script:
---------------
require_once("Log.php");

$logDB =& Log::singleton('sql', 'log', 'logger', array("dsn"=>"mysql://user:pass@host/database), PEAR_LOG_DEBUG);

Expected result:
----------------
I expect the Log object to be created with no output.

Actual result:
--------------
Fatal error: Call to undefined method Log_sql::_sql() in /usr/lib/php/Log/sql.php on line 124

[2005-10-25 14:53 UTC] schuster at TSinter dot net

I think there is an equals sign missing in line 124 of sql.php.

/* Now that we have a table name, assign our SQL statement. */
if (!empty($this->_sql)) {
$this->_sql = $conf['sql'];
} else {
/**
* FIXX HERE
*/
$this->_sql = ('INSERT INTO ' . $this->_table .
' (id, logtime, ident, priority, message)' .
' VALUES(?, CURRENT_TIMESTAMP, ?, ?, ?)');
}