PHP: Framework Faceoff

I was away from the PHP world while traveling in Europe and in four short months some nice PHP MVC frameworks seemed to crop up out of nowhere. I’m starting a fairly large project and was determined to use one of these new frameworks as the design and ‘free’ functionality that they offered seemed too good to pass up. However, there was almost too many choices. It was hard to choose between: Cake PHP, Code Igniter, Akelos, PHP Dev Shell, and many others.

For me it ended up coming down to Code Igniter (CI) and Kohana. Kohana is actually a branch off of the CI codebase, keeping with alot of the design choices that make CI attractive, yet stripping the codebase of support for PHP4 and some other legacy technologies and adding support for some of the more advanced PHP5 features. In short Kohana seems like a clean, lean, more ‘modern’ version of CI. I’ve been developing with it for a week and highly recommend checking it out. One of the features I’ve been most impressed by is ORM which uses SQL schema extrapolated from the source database to create a editable object that can perform all CRUD operations. This means only one or two lines of ‘glue code’ to handle the M of the MVC design pattern – Cocoa Bindings for PHP!

The community around Kohana is very impressive for a fairly new PHP framework, I’ve found some very nice addons which have saved me hours of development time:

  • Formo – Easy form creation and validation
  • Message – Easy error/info messages across PHP sessions
  • Head – Dynamic head creation using PHP
  • s7nCMS – Nice CMS package
  • And much much more

I’ve even posted one of my small extensions.

Videobox & Mootools 1.2.x

I love MooTools. I’ve been using it before the 1.2 days; it has been great watching how much it has matured. One of the best things about MooTools is the amount of components that have been written for it: Videobox, SlimBox, and TextBoxList just to name a few. However, the switch from 1.1 to 1.2 broke alot of existing functionality and with that broke alot of the existing components.

Just the other day I found just the component I was looking for: Videobox. The examples on the site looked great, but it didn’t work with the newest version of MooTools. I spent some time converting the animation code over to the new 1.2 syntax and fixing some other random bugs, you can grab the fixed version here. I emailed the developer with the fixes, so hopefully he will post it on the project page soon.

Regex Revisited: Ack, SED, and TextMate

Grep has long been considered the de-facto regex command line tool for unix developers, but I’ve never really liked it. Grep has always seemed slow, buggy, and limited in its regex capabilities; I always resorted to using the built in regex functionality of TextMate or Python’s built in regex abilities.

As great as Python and TextMate are, they are not a clean solution to a simple problem and do not play nicely with shell scripting. Thankfully I’ve finally found a regex tool that fulfills my expectations: ack. There is an even a “Ack in Project” TextMate Plugin (so long Grep in Project) which works blazingly fast. Combine ack with the fixed and fully functional macports gsed (aka GNU sed) and I my command line text processing facilities are finally what they should be.

On a quick side note, I’ve come across another nice plugin for TextMate: ProjectPlus. ProjectPlus adds some nice UI as well as functional additions to the standard project drawer, it’ll help hold me over until TextMate 2.0 comes around.

Apple Mail: Mark as Replied

A while back I added a small file to the source section of this site, MarkAsReplied.applescript. Couple this small AppleScript with MailActOn and you have an easy way to change the replied status of messages. I have another post in which I posted a script to allow the marking of messages as unread. Although these are small little functionality additions to Apple Mail, they have helped keep my different mail accounts organized.

Best CSS Compression Around: CSS Optimizer 1.1

After almost four years I’ve released the next – and possibly the last for a very long while – version of CSS Optimizer. Aside from minor optimizations, I’ve fixed the last remaining parser bug having to do with “font: 62.5%/1.2em”. I haven’t yet updated the GUI application, but the command line application for linux and os x is updated. I’ve also fixed all issues with the online web css optimizer. Also a little while ago I added a css optimizer web service to allow easier integration to custom automation systems.

I’ve tested CSS Optimizer against some of the newer CSS optimizers such as YUI compressor as well as other online compressors and CSS Optimizer has always come out on top. I’m not one to claim having the “best of” something but I’ve tested many CSS files and CSS Optimizer has always created smaller files and is easy to integrate into any production script/automation system.

Interactive PHP Shell

PHP is an amazing language, I’ve appreciated it and its community more and more since I’ve been forced to mull through some ASP code. One thing it lacks in comparison to other languages such as BASH, Python, or Ruby is an interactive shell to test code in. A while back I found a nice little command line script that creates a quasi PHP shell. It isn’t perfect but it works pretty darn well for simple code testing and makes developing PHP scripts a bit easier. In addition to the command line shell a couple days ago a simple GUI PHP console, PHP console, was released. It seems to work fairly well, although I prefer the command line shell.