For your consideration: Object-Oriented PHP and OpenID
BIOS LEVEL March 3rd, 2007ObsidianTaking a break from Nick’s Skype Challenge, I want to look at BIOS_LEVEL’s new look and backend.
Graphical Changes
While the new design is still unfinished, it remains functional. A few graphical elements still need to be finished, mainly the tabs under the logo and the logo itself. I’d also like to add a gradient to the logo area (just a simple gradient, not another glass-like bar) as well as to the Menu headings on the left hand column. Then I think the CSS needs touched up a bit for the news; add in some color to separate all the different elements (title, links, content). Since I’m on Spring Break this upcoming week, maybe we’ll all see a little change.
Object-Oriented Design?
When we started the new design, we also changed how the page was written to the screen. We moved from my simplistic template engine (if you can call ereg_replace() that) to Smarty. We’re not using Smarty for anything spectacular, just as a template engine. Colin knows a lot more about Smarty than I, but we haven’t tried anything beyond simple element replacement and insertion.
Anyways, using Smarty meant I had to re-write a lot of the backend. Mainly, object-UN-orient it. That’s how you see it right now (and why more than 1/2 of the pages don’t work). Frankly, it feels inefficient. After re-writing the “About Us” and “Profile” pages to not use the OO-approach, I realized it is. For the simple calls I had to do with the OO backend, I now have to pass a million variables. These are taking up unnecessary amounts of memory, especially considering passing by reference is disabled in many cases (objects, primarily). Instead of accessing $this->user for session variables, I now have to pass the $user variable to every function that needs access to it. Same goes to the database connections.
I don’t like it. Along with the graphical changes mentioned above, I’m probably going to re-write the backend this week as well to take a more object-oriented approach once more.
OpenID
I first started considering implementing OpenID on my own blog, but decided against it in favor of remotely accessing BIOS_LEVEL’s userbase. Now that sites such as Digg and others have announced support for OpenID, Colin feels we should join the bandwagon. I’m inclined to agree. More functionality for us, and easier migration for anyone who joins our forums that already uses OpenID. At first, we thought we may have to find a new forum that supports OpenID, but I just found phpBB-OpenID. I haven’t tried installing it yet, but it looks simple enough to use for admins and users alike. Keep your eyes open for it.
