Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Won't Fix
-
Affects Version/s: 1.9.0
-
Fix Version/s: None
-
Component/s: Zend_Config
-
Labels:None
-
Tags:
Description
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() [<a href='function.simplexml-load-file'>function.simplexml-load-file</a>]: /is/htdocs/wp1133477_NBOOWRX8MH/www/alpha/application/configs/app.config.xml:65: parser error : StartTag: invalid element name simplexml_load_file() [<a href='function.simplexml-load-file'>function.simplexml-load-file</a>]: <1002>SET NAMES utf8</1002> simplexml_load_file() [<a href='function.simplexml-load-file'>function.simplexml-load-file</a>]: ^ simplexml_load_file() [<a href='function.simplexml-load-file'>function.simplexml-load-file</a>]: /is/htdocs/wp1133477_NBOOWRX8MH/www/alpha/application/configs/app.config.xml:65: parser error : expected '>' simplexml_load_file() [<a href='function.simplexml-load-file'>function.simplexml-load-file</a>]: <1002>SET NAMES utf8</1002> simplexml_load_file() [<a href='function.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]
<db>
<isDefaultTableAdapter>1</isDefaultTableAdapter>
<adapter>pdo_mysql</adapter>
<params>
<host>localhost</host>
<username>blabla</username>
<password>blublub</password>
<driver_options>
<1002>SET NAMES utf8</1002> <--- SADLY THAT DON'T WORK
</driver_options>
<dbname>brablbrabl</dbname>
</params>
</db>
[/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?