ZF-7439: Problem with Zend_Config_Xml and DB Params

Issue Type: Bug Created: 2009-08-01T08:23:44.000+0000 Last Updated: 2012-05-09T16:52:51.000+0000 Status: Closed Fix version(s): Reporter: Markus (rockaut) Assignee: Adam Lundrigan (adamlundrigan) Tags: - Zend_Config

Related issues: Attachments:


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]


Posted by Matthew Weier O'Phinney (matthew) on 2009-08-02T06:00:21.000+0000

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?

Posted by Ben Scholzen (dasprid) on 2009-08-02T06:16:16.000+0000

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.



Posted by Markus (rockaut) on 2009-08-02T23:21:33.000+0000

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?



Posted by Adam Lundrigan (adamlundrigan) on 2012-05-09T16:52:51.000+0000

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



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.