ZF-2016: Can not enable db profiler from zend_config_ini

Issue Type: Bug Created: 2007-09-30T05:04:11.000+0000 Last Updated: 2007-12-15T21:46:38.000+0000 Status: Resolved Fix version(s): - 1.0.3 (30/Nov/07)

Reporter: Jacob Oettinger (oetting) Assignee: Darby Felton (darby) Tags: - Zend_Db

Related issues: - ZF-2021



When defining database configuration in an ini-file it is impossible to enable the db profiler directly from the params object as shown below:

database.adapter = pdo_mysql = localhost database.params.username = dbuser database.params.password = dbpass database.params.dbname = db database.params.profiler = true

This happens because the setProfiler method in Zend_Db_Adapter_Abstract thinks anything but real booleans are class names for a profiler class, and the Zend_Config_Ini object will return: string '1' (length=1)

This results in the setProfiler method trying to include a class named '1'.

Two possible solutions could be. 1. Change the setProfiler method so that it interprets input differently, for instance by adding something like: if($profiler==='1') $profiler = true; if($profiler==='0' || $profiler==='') $profiler = false;

at the beginning of the method.

  1. Change Zend_Config_Ini so that it returns a true boolean.


Posted by Darby Felton (darby) on 2007-10-01T15:39:21.000+0000

Fixed for 1.1.0 with SVN r6556.

Posted by Darby Felton (darby) on 2007-11-15T10:18:32.000+0000

Fixed for 1.0.3 with SVN r6829

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.