ZF-7439: Problem with Zend_Config_Xml and DB Params


Hello there!

I updated to 1.9.0 and wanted to use a xml file as config from now on thanks to support of PHP constants BUT ;-)

[code] Fatal error: Uncaught exception 'Zend_Config_Exception' with message 'simplexml_load_file() [function.simplexml-load-file]: /is/htdocs/wp1133477_NBOOWRX8MH/www/alpha/application/configs/app.config.xml:65: parser error : StartTag: invalid element name simplexml_load_file() [function.simplexml-load-file]: <1002>SET NAMES utf8</1002> simplexml_load_file() [function.simplexml-load-file]: ^ simplexml_load_file() [function.simplexml-load-file]: /is/htdocs/wp1133477_NBOOWRX8MH/www/alpha/application/configs/app.config.xml:65: parser error : expected '>' simplexml_load_file() [function.simplexml-load-file]: <1002>SET NAMES utf8</1002> simplexml_load_file() [function.simplexml-load-fi in /is/htdocs/wp1133477_NBOOWRX8MH/libraries/Zend_1.9.0/Zend/Config/Xml.php on line 98 [/code]

I got the error because of this line in my config file

[code] 1pdo_mysqllocalhostblablablublub <1002>SET NAMES utf81002> <--- SADLY THAT DON'T WORK brablbrabl [/code]


Element names need to be valid PHP variable names, IIRC -- which is problematic here as the various PDO_MYSQL constants are all integers, and the constants are all class static constants.

Rob or Ben -- any ideas on how to improve it?

A solution would be to either support class constants, and/or introduce a namespace related type like from my short params proposal for 1.6:


But well, regarding this issue, SET NAMES utf8 is not required anymore, there is a option for all DB adapters since 1.8.

I would like to see this approach Ben. It also would be consistent with the Solution for constants.

Thank's for the hint to DB charset option. Haven't known this... hm can't find this improvement in 1.8 release notes?

Closing as "Wont't fix" due to complexity of necessary changes and existence of viable workaround (charset option)