简体   繁体   中英

zend_config_ini broke after upgrade to zf 1.9

I recently upgraded my zend framework install from 1.7 -> 1.9. Everything was working prior to the upgrade. I've managed to correct all issues except this particular one.

My problem is this. When calling values form a zend_config _ini object the standard 'Setting=Value' scheme works, as long as the setting is not an integer. If the Setting is an integer, then ZF ignores the setting and substitutes the array index for that particular entry.

Consider the following example:

[general]
;Database connection settings
db.adapter=PDO_MYSQL
db.host=localhost
db.username=dev2
db.password=***
db.dbname=dev2

[characters]
11=Tom
10=Jerry
9=Tweety

The [general] section works fine.
The [characters] section returns:
[0]=> "Tom" [1]=>"Jerry" [2]=> "Tweety"

I'm expecting (and was getting, prior to the upgrade):
[11]=> "Tom" [10]=>"Jerry" [9]=> "Tweety"

Note: I manually tested w/ php's parse_ini _file() on my config.ini and the results were what I expected, which leads me to believe that this is a ZF thang. help?

I swapped out my v1.9 Zend/Config/Ini.php with an older version form 1.7, and that resolved the problem (for now), which reaffirms my suspicion that something broke in ZF.

I went to create a bug report with zend and found that this is an existing, unresolved, issue. Bug ZF-6508 .. existing since v1.8... whoops!

Thanks ispytodd, reverting back to the 1.7.8 version of config.php solved the same problem I was having.

I was wondering if using this older version is going to cause some other future problems, however?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM