ZF-2016: Can not enable db profiler from zend_config_ini


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.


Fixed for 1.1.0 with SVN r6556.

Fixed for 1.0.3 with SVN r6829