Larry Ullman

Translating Geek Into English

Yii vs Zend vs Code Igniter Compared

I’m often asked why I like the Yii framework, which is easy enough to answer: for starters it requires PHP 5 and uses jQuery natively. Then I like how it auto-generates a lot of code and folders for you. From there, it just kind of works and makes sense to me. In other words, Yii feels right. And unless you really investigate the framework’s underpinnings, how it feels (and can you get it to do what you need to do) is a large part of the criteria in making a selection.

The question I can’t really answer is what advantage Yii has over the X framework. The only other PHP framework I’ve used extensively is the Zend framework. The Zend framework has a lot going for it and is worth anyone’s consideration. To me, its biggest asset is that you can use it piecemeal and independently (I’ve often used components of the Zend Framework in Yii-based and non-framework-based sites), but I just don’t like the Zend Framework as the basis of an entire site. It requires a lot of work, the documentation is overwhelming while still not being that great, and it just doesn’t “feel” right to me.

Opera Dragonfly for Web Site Development

Admittedly, Opera is about the fourth browser on my list (after, in order, Safari, Chrome, and Firefox), but the release of Opera Dragonfly may just change that for me, at least when it comes to Web development. Historically I’ve always relied upon Firefox’s Firebug extension when I need a good development debugging tool, but the Firefox browser has become such a memory hog for me that I’ve stopped using it on a regular basis. Of course, it’s probably a memory hog exactly because I’ve installed so many extensions (Firebug and the Web Developer Extension and …)!

On a cursory glance, Dragonfly may have everything I need:

  • DOM viewer
  • JavaScript debugger, allowing you to set breakpoints, inspect the values of variables, and set conditions to watch for
  • HTML and CSS editor
  • Resource inspector (what resources are loaded by the page)
  • Network traffic tool, a must for debugging Ajax, including the ability to craft your own requests to see the response
  • And more.

Unlike Firebug and other extensions, Dragonfly is built into Opera. Also unlike any comparable tool, Dragonfly can be used for remote debugging, including content destined for mobile devices or televisions!

UTC and Time Zone Support in MySQL

I’m currently working on the fourth edition of my “PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide” book, due out later this summer. In it, I discuss how to effectively use MySQL’s support for time zones. Specifically, there’s an argument to be made for storing dates using Coordinated Universal Time (strangely enough, abbreviated UTC). UTC is commonly the same time as Greenwich Mean Time (GMT), except during the summer when the UK is an hour ahead of UTC. And that’s the point of using UTC: storing times (and therefore dates) in a format indifferent to any particular time zone. By comparison, my forum software or my blogging software may likely be storing times using the local time zone for the server. That may not seem like a problem until I move the site from one server to another in a another time zone, thereby introducing a disparity in the times. How critical of an issue is that? Well, it depends upon the application, but there’s an easy fix: storing times and dates in UTC.

How I Cut My Bandwidth In Half

In January of 2011, the third full month after putting this site online, there were roughly 450,000 page views requiring 27GB of bandwidth (i.e., mostly data provided by the server to users). In April of 2011, there were also 450,000 page views, but only 14GB of bandwidth. That’s a dramatic difference: half the bandwidth for virtually the same amount of traffic! This wasn’t a goal of mine (my hosting plan allows for up to 1TB of bandwidth per month), but happens to be a great side benefit of three steps I took, primarily with the aim of improving the site’s performance (i.e., how quickly pages load for visitors). Here’s the full scoop…