CakePHP Digest #12 - The Birthday Edition

Posted by Matt on Mon, Apr 20 2009

News

Happy Birthday CakePHP

Gwoo marked April 16th as CakePHP's birthday. Taking a stroll through SVN it looks like the first real commit was #13 on April 24th, 2005 by pies, with the message "0.2.7 pure". If you're ever longing for the days when Cake was pure as the fresh driven snow go ahead and start a project with version 0.2.7.

Tickets and Commits

I've been a bit slacking in following the tickets and commits lately. So since I have nothing much to add here, I'll remind everyone if they want to contribute check out the "Test Cases & Open Bugs in Need of Test Cases (Core Code Only)" report. There you can find defects in need of test cases. It's a good way to learn the core code and unit testing if you're not already a master. Plus for each test case you contribute CakePHP pays you 10 Million Theoretical Internet Dollars.

In The Wild

www.bon-voyage.co.uk

@neilcrookes announced www.bon-voyage.co.uk a site that sells "customised North America experiences to primarily UK audience."

www.awhatup.com

This one was mentioned in last weeks comments. The site is www.awhatup.com, an Asian hip hop site. Thanks to this site I've finally found what's been lacking from American Hip Hop - mac and cheese. Everyone does the money, guns, drugs thing, but how is it we've gone this long without including mac and cheese in da mix?

Miss USA

Also from Twitter: The Miss USA site - check out the favicon for proof. I couldn't pick just one joke here, so I'm going to run them all:

  • Finally, there is something to fap to besides CakePHP.org and the Firefox extension site.
  • What's more messed up? That they let you rate the contestants or virtually all of them are currently 2.5 (out of 5) or lower?
  • Better catch phrase: "See the future face of Cinemax late nights - The Miss USA Pageant" or "The Miss USA Pageant - It's like Miss America, but with more Trump!"

Did I mention they allow user comments, which led to these gems:

  • "You sorta look like a man. sorry."
  • "If you work it with catwalk, a top 15 spot is possible." - Great backhanded compliment.
  • "The only problem with photos is no one can see that you are just as beautiful on the inside as you are on the outside." - Obviously this person doesn't look at the same internet photos as I do.
  • "She sounds like Britney Spears when she talks"
  • "Your dreams FINALLY came true!" - Assuming her dream was to be compared to Michael Jackson ("Your ugly and look like michael jackson. Sick."), then yes: Mission Accomplished
  • "Great body! Butterface."
  • "I kinda wanna give her a sandwich."
  • "what question was she asked where she answered 'daddy long legs'?" - I was caught this on TV. The question was "What insect goes best with a glass of Louis Jadot Le Montrachet 2006?" To her credit she didn't even hesitate.
  • "I'm her sister and she definitely has no wrinkles anywhere on her body!" - ummm...pics or it didn't happen?

I could literally go on for pages like this...

In The Blogs

JS and CSS Compression

Miles took the time to figure out how the quasi-built in CakePHP JS and CSS compression works.

Eventful

cakealot put together a cool looking plugin for handing events in your application. This seems like a good way to organize your code and would be useful if you were building an app that had it's own plugin architecture.

Admin Pages

ActionShrimp is back with a tutorial on how to use the pages controller with admin routing. What I like most about their code is the lack of indention. It's like they're tossing a huge FU to the whole tabs vs spaces debate.

In The Groups

The topic of offline documentation came up again. It's been suggested before, that the easiest thing to do is save the one pager.

This was an interesting discussion on the current state of Cake's plugin system and it's limitations.

Code

DaemonTask

I know this is an old one, but it's the first time I've seen it, so deal. Besides, it's not often I can link to a task.

ACL Cache

I like the idea behind this ACL caching component, but I really wish it didn't depend on the name space file caching engine. I understand the reasoning here (partial key support), but would have rather seen it handled in the component, so that any of the engines would work. Also the benchmarks don't really show any difference when the component is used...someone needs a lesson on doctoring results. My class, "Run a shit load of bittorrent downloads for the before benchmark," begins next week and runs through the spring semester. Taking sign ups now.

I'm Out!

And on that note don't forget to subscribe to my feed or follow me on twitter.

As always if you think I missed something leave a comment. Or if you do something interesting and want it included in the next digest, send me an email.

Posted in CakePHP Digest

6 Comments

TG said on Apr 21, 2009
Oh no, showing that miss usa uses cake will anger people over the potential lack of documentation on how to change a fave icon. :)
Matt said on Apr 21, 2009
hahahaha...early front runner for comment of the year.
Phally said on Apr 21, 2009
Hi there,

Great to see that you read my bakery article(s) about Caching ACL permissions. However, it seems you haven't read it quite good enough or maybe I wasn't clear enough (for which I'm sorry). The benchmarks aren't to show it is the fastest option, it is to show it is not slower. This could be read in:

"These are the benchmark results, as you can see it is actually faster too. The results depend on the number of queries issued, so it might not always be faster."

The real purpose for the component is to get the load from the database servers to the HDD. We have a central cache server that handles this (and other) stuff. You could read it in the intro:

"When you set up ACL with a bunch of groups with subgroups, you will end up with five or maybe more queries per request. When you have a lot of active users it might fry your database. This is a simple solution to get rid of all those queries."

So maybe it is you in need of a reading lessen then. :)

Cheers,

Phally
Matt said on Apr 21, 2009
The benchmark thing:
I understand presenting a baseline case...but don't you also want to show a scenario where your code is a significant improvement? I'm reading that and I see a .02 second difference. I'm not getting excited over saving 20 milliseconds.

The cache engine thing:
I get what the component does...not sure where you think I misunderstood. I'm saying for it to be useful to other people it shouldn't be tied to a particular cache engine.
Phally said on Apr 21, 2009
Hey Matt,

It wasn't designed to be a significant improvement in speed, the speedup is just a small benefit. As I said before, the benchmarks are there to show it isn't slower, not that is excitingly faster.

About the CacheEngine; I haven't figured out a way to implement namespaces for engines like Memcache. Those engines work purely key based. So you will end up clearing the entire Cache or looping through keys everytime a user changes groups or the rights of a user/group change. Then the entire cache needs to be rebuild. Not very efficient.

Besides that, with 750000 users, and 20 actions, the maximum amount diskspace taken is ~250MB. However this will probably never happen, there will be a lot of space taken (18 bytes per ARO/ACO permission). You will have to consider if you want it in your memory.

This was the most efficient approach I could think of.
kvz said on Apr 22, 2009
I posted a comment at the bakery considering DaemonTask. You may find it interesting as well:


A neat trick: You can also open a socket and bind it to 127.0.0.1. Don't do anything with it. But the second time any process tries that, it fails. Hence allowing only 1 instance without relying on ps. Obviously pick a ridiculous port that isn't used by any known service (cat /etc/services).

Or, you could create a real daemon with PHP using a PEAR class I wrote:
http://kevin.vanzonneveld.net/techblog/article/create_daemons_in_php/
PEAR
is optional though, it can also run standalone.

PS
I'm starting out with Cake and your site has been a great resource. Using the jquery validation thing & many of your speed tips and it works like a charm. So thanks a lot for sharing great stuff here.

Add new comment