Pragmatism in the real world

Zend_Config is in the Incubator

Just a quick note that the Zend_Config work I've been doing is now in the incubator within the official svn tree! (Trac link: http://framework.zend.com/developer/browser/trunk/incubator/library/Zend/Config) Thanks to Darby for sorting this out! Now everyone needs to go and bash on it and report bugs :)

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: Of course, it all depends on what is meant by "nesting" in the comment I've quoted :) It's likely that… 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.

PHP West Midlands Meeting

Last night was the first meeting of the West Midlands PHP User Group. The phpwm is a mailing list group of around 100 members and now we've placed some names to faces. Jono Bacon organised the meeting, and Open Advantage graciously hosted it and even provided food! To get us started, we had three short talks: David Goodwin of Pale Purple talked about Smarty and separation of business code from display code. Elliot of Open… continue reading.

The Zend Framework PDO driver's insert() function is fixed!

This bug is finally fixed in subversion revision 386 of the Zend Framework. The Zend Framework now as a bug tracker and this bug was reported in tickets #21 and #32. I noticed #36 first though, so attached the correct patch there. A little later I committed it to subversion and that bug is gone! Next up is unit tests for the Zend_Db tree. I've created ticket #36 to track my first attempt at getting… continue reading.

Zend_Db_Adapter_Pdo_Abstract::insert()

(Putting this here, mainly so that I can reference it!) There's a bug in Zend_Db_Adapter_Pdo_Abstract::insert(). I posted in to the mailing list and it's available here in the archives. In short, if you use the PDO drivers and have table field names with underscores in them, then you need to delete the insert() function within the class Zend_Db_Adapter_Pdo_Abstract.

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: