Hi,
I'm currently using the Log class, logging into a database, and the following
code to instanciate the class works fine :
$dsn='mysql://myuser:mypass@localhost/mybase';
$log=&Log::singleton('sql','log_table','',array('dsn'=>$dsn));
But when using in the configuration array a data source name specified as an
array of the format returned by DB::parseDSN like that :
$dsn=array(
'phptype' => 'mysql',
'hostspec' => 'localhost',
'database' => 'mybase',
'username' => 'myuser',
'password' => 'mypass'
);
$log=&Log::singleton('sql','log_table','',array('dsn'=>$dsn));
or when using directly a database connection :
$db=DB::connect($dsn);
$log=&Log::singleton('sql','log_table','',array('db'=>$db));
I obtain the the following error notice :
Note [8] Array to string conversion in /usr/share/pear/Log.php line 139
Coming from the implode function in the signature computation :
$signature = md5($type . '][' . $name . '][' . $ident . '][' .
implode('][', $conf) . '][' . $maxLevel);
Regards,
--
Frederic Poeydomenge
--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
|