Pragmatism in the real world

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:

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.

Zend Framework: Router Again

I've updated Akrabat_Router to take advantage of a patch posted by Christopher Thompson on the fw-general list. I've also put in support for using traditional request variables so that I can have urls like http://localhost/zf_test/index.php?command=user&action=login etc. This is mainly for use with IIS as ISAPI_Rewrite costs money :) The class now looks like this:

ZF Authentication

I was going to look at storing content to the database having done collection of data from the database. However, in trying to that, it became obvious that I need to look at logging in too. Looking at authentication first I decided to approach it using the Front Controller's Plugin system. However, having got half way into the implementation, I'm not convinced. Ideally you need finer control and only request for logging for specific controllers… continue reading.

Zend Framework: Test Code Upgrade to 0.1.2

I've upgraded my test application to Zend Framework 0.1.2 and these are my notes: I've changed my directory structure to match the one suggested in the manual. This involved moving a few files around, but nothing to major. I also changed all the paths in index.php to point at the new places. The new directory structure looks like: