Clay’s Progress

Clay Framework had taken a back seat for a little over a month, but things were moving again this past week. Unfortunately, this next week is going to be a no-go for development. I hope to get back into it hard next weekend and try to get an alpha release out around the first half of March. I call it alpha, but I measure by completeness, not stability. I’ve been hammering out a lot of little bugs lately and adding some new features along the way.

I’ve always been one of those guys that tests the crap out of everything and never felt the need for exception handling. I always use if(empty()), if(!file_exists()), etc to keep the flow and sanity, but just never understood the need for try{}catch(){}. That, my friends, has changed. While dancing with a couple of bugs this week, I almost gave up and scrapped the entire project. It was ridiculous. One little return false at the bottom of a file, 3 directories up, was keeping my app from loading and I couldn’t figure it out. It took 3 days of dancing before I realized my appended prefix of .pbp, which should have been .php, was causing my import function to fail. It took me 3 days, because my import function didn’t tell me it failed, it just returned false and everything else kept going. Live and learn…

Clay Framework now has exception handling. I’m using the built-in PHP Exceptions, but that is mostly because I don’t really see (yet, I’m sure) the need to reinvent exceptions. I had been using a redirect to an error application, which was pretty cool since it used custom error codes. With the Error app, you could register error codes from your application or API, and redirect to the error app when needed. Unfortunately, sometimes there’s a bug that prevents the error app from loading and then you are just stuck with a return false (or I was at least). The cool thing about my use of Exceptions is it uses a bit of redundancy, but doesn’t go overboard and Clay tries to keep going. That means instead of a single error message, you’ll have as much of the page as Clay could render, with whatever exceptions shown in their respective places. It’s made a big difference already and helped me knock out a few more bugs since I implemented it earlier.

That phantom I keep calling the Clay Installer is finally becoming somewhat of a ghost. The direction it took this week is way beyond what I planned to have in a pre-1.0 build, but I ran with it anyway. Initially, I was happy having packages that defined the configuration information and then the rest of the installer was a manual install tool (kind of like Zend Server’s administration). Basically, it made Clay like the typical frameworks (Zend, CakePHP, etc), where you have the framework and just build on it however you like, plus a simple install tool. While prepping the Installer, I ran across a bug, which turned out to be a pretty cool feature. I shined the bug up a bit, put a nice collar on him, and named him the package manager. Clay’s Installer went from Lincoln Logs to Legos. What I’ve done is used a custom initialization function (yup, Clay supports that) to allow the Installer to load packages as if they are applications. Whereas before you’d name the package in the Installer, now you create a namespace for a web site, then assign a package to that namespace. Each package is it’s own installer, so Clay’s Installer is just there to lend a hand once a package is selected. The cool thing is the packages are loaded inside the Installer and are theme-able. So they can be branded and have that independent feel, but still fall back on the Installer for whatever they need. To take up the slack and preserve it’s previous manual installation feature, I’ve created a package named Custom that will allow you to “build” custom installations. I said “build” because it doesn’t really build yet, but a planned future improvement is to allow you to clone your custom package and actually build new packages.

Other than that, I updated the Installer’s ctx-1 theme with some CSS3 and just tidied up here and there in the APIs. Things look a lot better than a week ago, but I need to step it up some more. I want to have the ClayCMS package available when I release the first alpha, but I can’t make any promises there yet.

March 12, 2010 is the release date. Whatever isn’t finished by then will have to wait until the next release.

Tags: , , , ,

Leave a Comment