|
|
|
Sorry, didn't found any reports on such topic. Well, I'm not very clear of how to use this issue tracker and other things on this project
Both versions, yours and mine will work, but imho my version is easier. Maybe I'm wrong. First, thank you for creating an issue for this problem. Problems get solved because people have patience to report them using our issue tracker.
> By the way, where I can find unreleased versions? I was just about to discuss this with the dev team. Your version will break all existing, working ZF apps that use pdomysql instead of pdo_mysql.
Our goal: make ZF easy to use. Since we don't want developers to study the relationship between "pdo<name of PDO adapter" and our file naming structure for these subcomponents, we choose to make the code more forgiving of capitalization variances and make the '_' optional. Thank you for your responses.
I agree with you about pdo... Even totally agree. > Our goal: make ZF easy to use. Note: There were numerous commits repeatedly fixing and breaking this issue (by breaking support for 'pdomysql'), but release 0.1.5 will support both 'pdo_mysql' and 'pdomysql'. Release 0.2 will not support 'pdomysql'. The use of underscores is now deprecated.
|
||||||||||||||||||||||||||||||||||||||||||||||||
The current solution: use 'pdomysql' instead of 'pdo_mysql'
However, the current code's inflexibility towards '_' and capitalization is not "user-friendly".
Untested solution follows:
$ svn diff Index: Db.php =================================================================== --- Db.php (revision 698) +++ Db.php (working copy) @@ -165,8 +165,12 @@ throw new Zend_Db_Exception('Configuration must be an array'); } - if (substr($adapterName, 0, 3) == 'pdo') { - $adapterName = 'Zend_Db_Adapter_Pdo_' . substr($adapterName, 3); + $adapterName = strtolower($adapterName); # normalize input + if (substr($adapterName, 0, 3) === 'pdo') { + $adapterName = 'Zend_Db_Adapter_Pdo_' . + str_replace(' ', + '_' , + ucfirst(ltrim(substr($adapterName, 3),'_'))); } else { $adapterName = 'Zend_Db_Adapter_' . str_replace(' ',