CakePHP: The Lazy Man’s Ruby on Rails

For all of you out there who have heard great things about Ruby on Rails but are too lazy to a) learn a new language and b) switch web hosts: well, frankly, you don’t deserve Ruby on Rails.

That said, you can use it anyway with a nifty surrogate technology called CakePHP. I’ve had a chance to start toying with it, and so far the down side I see is the absence of built-in database migrations (although a somewhat primitive migrations snippet is available here). There is also no pre-packaged equivalent to Rails’ ActionMailer, and I don’t yet know whether the independently developed solution is any good.

So far, however, I like CakePHP so far and am using it for projects that can’t move off existing hosting. It’s great because unlike some of the other new PHP frameworks out there, it supports PHP4. Here’s a great beginner’s guide to Cake to get you started.

Since I’m a newbie myself, I would appreciate hints and feedback to this Rails alternative. Have you used it? Do you like it? And, the question that interests me most about web frameworks: what are its fatal flaws?

Update: As per the kind comments below, Cake’s bake.php acts much like Rails’ generator scripts. Would appreciate further discussion as to how it sizes up in terms of robustness.

This entry was posted in Technology. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

4 Comments

  1. Posted October 6, 2006 at 4:32 am | Permalink

    I’ve just discovered cakePHP, and I love it! I’m using it to implement a new custom issue ticketing/reporting system for my company (since none of the off the shelf products do what we want) and it’s been nothing but great.

    A few pitfalls to watch out for:

    1 – Make sure you stick to the naming conventions – you really need to stick to them to make life easy on yourself. I didn’t. Whoops.

    2 – Use the fully-fledged relationships declarations ($hasOne, $hasMany) in your models to have control over cascade deletions

    3 – Keep the ‘bakery’ (bakery.cakephp.org) bookmarked, and if you have time contribute to it. Lots of users are submitting stuff all the time and you may just save valuable coding hours by using a snippet or component or helper someone else has already done!

  2. Posted October 6, 2006 at 4:35 am | Permalink

    4 – use scaffolding for rapid prototyping and logic testing. Develop your views later.

  3. Posted October 6, 2006 at 5:53 am | Permalink

    There is the bake script you can use to generate models, controllers and views.

  4. Posted January 10, 2007 at 8:50 pm | Permalink

    I have used it in few of my projects. It’s a great framework. One of its fatal flaws is the ActiveRecord (as it is in RoR, imo), if you are going to develop a high traffic website, you may find it slow. You can try to fast up the process by avoiding the ActiveRecords thing or try to use any other DAL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>