[Log class] Problem when Logging into a database
| From: | Frédéric Poeydomenge | Date: | Thu, 28 Nov 2002 11:53:16 +0000 |
| Subject: | [Log class] Problem when Logging into a database | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-11219@lists.php.net to get a copy of this message | ||
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