CakePHP: Gift from Heaven, or from Hell?

My development activies have called on my skill and talent to quickly and efficiently learn new things. So it is with CakePHP, at work we have several projects that need to be completed quickly with out much hassle, after looking at several different options, we decided to use the CakePHP libraries. I quickly discovered that CakePHP has some awesome features that allow me to quickly and easily built website from scratch.

Although this frame work provides a ton of flexibility and power over the database associations and the layout of the site, I quickly discovered a large number of things that are either incredibly difficult to do, or that are impossible to do. The sad thing about this, is that these are basic database types of things that I ran into. I could understand if it were something very complex that no one does, but it is stuff that is an everyday kind of thing to do. Let me put forth an example:

Here is a very basic database to use with our example.

Videos
--------
id as int(11)
name as varchar(255)
icon as varchar(255)
path as varchar(255)
user_id as int(11)

Users
-------
id as int(11)
first_name as varchar(255)
last_name as varchar(255)
username as varchar(32)
password as varchar(32)
company_id as int(11)

Companies
--------------
id as int(11)
name as varchar(255)
description as text

As you can see, we have a very basic example that consists of Videos that are attached to users. Users are then attached to a company. I simply wanted to use cake to read in each video and use the model association of belongsTo to attach both a company and a user. (This is because each video only has one user, and each user only has one company.) This should be easy in CakePHP right? Wrong!

After beating myself in the head for hours trying to figure out how to get the company to attach properly, I decided to dig into the code of CakePHP itself. I quickly discovered that the framework is there to allow for this type of thing, is simply doesn’t work. After a few minutes of hacking on the core CakePHP sources, I was able to devise a solution. My solution even though it is not graceful, works.

The worst part of my experience was not running into this issue though. The thing that drove me nuts was that I tried to talk to the developers in the IRC channel for CakePHP and was quickly snubbed by the developers after trying to get them to give me an answer on how to get this to work properly I was banned from the channel. WOW. Way to go open source community. Want to know why the corporate world will never take you serious? It is because you can’t handle constructive criticism.

Anyway, overall I really do like CakePHP, but there is an issue here that simply drives me nuts. HELP OUT YOUR USERS!

One Response to “CakePHP: Gift from Heaven, or from Hell?”

  1. [...] CakePHP: Gift for Heaven, or from Hell? So it is with CakePHP, at work we have several projects that need to be completed quickly with out much hassle, after looking at several different options, we decided to use the CakePHP libraries. I quickly discovered that CakePHP has … [...]

Leave a Reply


Switch to our mobile site