Developing software in the Real World

Zend_Config Proposal v3: Akrabat_Config (8)

After discussion with Jayson on the Zend Framework's fw-general list and dealing with some excellent bug reports by Richard (aka OpenMacNews), I've come to the conclusion that the implementation of Akrabat_Config is wrong. I've redone it as two separate classes with no base class. We now have: Akrabat_Config Akrabat_Config_ini Akrabat_Config takes an associative array and provides read only access to it as properties properties . It also implements Countable and Iterator to make life easier.… continue reading.

Zend_Config Proposal v2.1: Akrabat_Config (7)

There's been quite a lot of interesting discussion about my Zend_Config proposal this week. As a result it became clear that the method of extension to multiple sections that I chose in Akrabat_Config v0.6 was not what was envisaged. I wrote up the four choices that I could see for doing inheritence into a post:

Fortunately Andi agreed with me, so I've updated the proposal to v2.1 and Akrabat_Config to v0.7 to support (2)… continue reading.

Zend_Config Proposal v2: Akrabat_Config (6)

A couple of weeks ago I received feedback from the Zend Framework core team about my Zend_Config proposal v1 and have finally found the time to updated the proposal accordingly. The key points with my comments interspersed were: – The Zend_Config class shall never modify configuration information in its storage containers That's ok – I never planned to do writing to ini file anyway. – The configuration information should only be allow to be modified… continue reading.

Akrabat_Config (5)

Matthew Delmarter noticed a problem with Akrabat_Config. Essentially when you load a single section that overrides one item of a nested array from another section, all the other items get "lost". I've fixed it and this time thought I'd supply a zip file of the files! Akrabat_Config-0.5.zip Akrabat_Config_Tests-0.5.zip I've also updated the code so that it can support different types of config files. We now have Akrabat_Config_Abstract and Akrabat_Config_Ini. A test for the bug is… continue reading.

Zend_Config Proposal for the Zend Framework

I posted a Zend Framework proposal for Zend_Config, obviously based on the work I've done so far for Akrabat_Config. The main difference from the Akrabat_Config posted here is that I've split the class into Zend_Config_Abstract and Zend_Config_Ini so that it can easily be extended to support YAML or XML or whatever other config file formats there are. The proposal is:

Akrabat_Config (4th Go!)

Ok, I'm dense! I've finally worked out what Nico was saying in that Akrabat_Config doesn't allow for more than one included section when using the "include=" construct. This is because parse_ini_file() will overwrite keys of the same name. Thus to support multiple sections the syntax has to be: include = one,two,three Akrabat_Config now looks like this:

Akrabat_Config (Take Three!)

Update: I've made the filename parameter in the constructor optional as per Nico's comment on the mailing list. I've also updated the code so that it meets the coding style There's been some more discussion about config on fw-general. Thanks all! I commented that I think the ability to load multiple ini files would be useful and suggested using an array of filename. Nico suggested: You could just put the code from the constructor in… continue reading.

Akrabat_Config (2nd Attempt)

Update! This version has been superceded! Check out Akrabat_Config (Take Three!) for an even better version… Nico Edtinger was kind enough to review Akrabat_Config and pointed out that it wouldn't handle a key with multiple dots in it. His post to fw-general: One method I don't "like" is processSection(). If I have a name like "foo.bar.baz" it would be saved as $config['foo']['bar'], dropping the last part because you explode without a third parameter. It should… continue reading.

Akrabat_Config

Update! This version has bugs! Check out Akrabat_Config (2nd Attempt) for a better version. Work has been manic, but I've finally found some time to do a bit more work on my Zend Framework test site. I've now got a concept for a simple CRUD type application that I'd like to write. It's hardly imaginative and I'm sure that there are loads of other ones out there already, but it'll do for testing stuff :)… continue reading.