From: Demian K. <dem...@vi...> - 2013-09-16 18:11:56
|
The issue is that by default, Zend Framework’s config reader splits up keys on dots to create arrays – but since VuFind’s configurations have all sorts of weird characters in the keys, I had to disable that feature to prevent things from parsing incorrectly. I’m setting the nest separator to an ASCII null (0) character, since it is impossible (or at least extremely difficult/unlikely) for that character to exist in the .ini files. Unfortunately, that’s bad news for you, since it means you can’t take advantage of the feature here. Have you tried using bracket syntax? loc_info[][name] = “GenRes” loc_info[][reserve] = 1 loc_info[][bookable] = 1 Not sure if that, or some variant of that, will work, but it might be worth a shot. - Demian From: anna headley [mailto:an...@gm...] Sent: Monday, September 16, 2013 1:54 PM To: vuf...@li... Subject: [VuFind-Tech] nested array in config I'm having trouble putting some arrays in my driver config in vufind 2. e.g. loc_info.0.name<http://loc_info.0.name> = "GenRes" loc_info.0.reserve = 1 loc_info.0.bookable = 1 loc_info.1.name<http://loc_info.1.name> = "VidRes" loc_info.1.reserve = 1 loc_info.1.bookable = 1 I would like the whole thing to turn into a nested array. But I get nothing unless I pull, e.g. "loc_info.0.name<http://loc_info.0.name>". I found this line in module/VuFind/src/VuFind/Config/PluginFactory.php $this->iniReader->setNestSeparator(chr(0)); So I changed my index numbers to letters and used zeroes instead of dots. But it's still not working. I see that normally ini files don't allow this sort of thing but it looks like zend does. Any idea what I am missing? Thanks, Anna |