What happens if you do a request?

Published on and tagged with cakephp  diagram

Ever wondered what happens if you do a request in your CakePHP application? Brandon Parise has drawn a diagram in which he shows in detail all involved steps to get from a request to the rendered view. It is ideal for those who want to know what’s going on behind the scenes, but too detailed for those looking for a high-level overview.

Diagram: http://www.cakecollab.org/lifecycle.png (this diagram no longer exists)

An alternative diagram can be found in the cookbook: http://book.cakephp.org/view/21/A-Typical-CakePHP-Request

Update 2008-12-19: Removing link to diagram which no longer exists, adding link to a similar diagram in the cookbook.

18 comments baked

  • http://tariquesani.net/

    I noticed the cakecollab.org domain name in the diagram – got any idea what it is about?

  • Dieter@be

    Aha, very interesting!

  • cakebaker

    @Tarique: No, I don’t know what’s planned with that domain.

  • pablasso.com » Blog Archive » El Ciclo de Vida en CakePHP

    […] Vía | Cakebaker […]

  • klevo

    This is awesome! It should be included right in the first page of Cake manual.

  • Brandon

    Thanks a ton for posting this! It was a very good learning experience for me! I hope that it is able to clear up many peoples question when it comes to, at least, when things are loaded and executed (especially for callbacks). Maybe eventually build this into a series like: “What happens when you do save()”.

    @Tarique: CakeCollab.org details will hopefully be unveiled this week. The idea behind it is to piggyback off of cake’s fantastic support community and bring it outside the underground of IRC .

    Cookie Jar: Similar to Experts-Exchange or Askville where bakers can post questions and other bakers in the community answer them for points (or cookies). Q&A’s will be archived so people can quickly find answers to common questions.

    Recipes: These are collections of CakePHP “modules” that can be imported directly into your project. For instance, an Article system will include all the basic MVC’s and SQL dumps that you can easily import directly into your project. Eventually would like to build this into a standalone package manager!

    Oven: A shared-hosting development environment where bakers can host their projects in a “pure” CakePHP production environment. Maybe eventually build this into a full hosting solution with client-management.


  • gwoo

    There are a few things out of place in the view section, and missing Component::initialize() along with the scaffold callbacks, but overall a pretty good diagram.

    @Brandon: I am also interested in hearing more about your plans

  • cakebaker

    @Brandon: Sounds great, I am looking forward to this application!

  • http://tariquesani.net/

    @Brandon – sounds great – but be sure to get a clearance from Cake Foundation on the legal issues (that just about the thing I don’t like about CakePHP – the legal part is not very clear)

  • Brandon

    I have been approached by the ‘enforcer’ of the Cake Foundation about the site and talked in lengths with him. To my surprise they are vehemently AGAINST the site altogether. Their main reason is they want to (eventually) deploy the same features and are pulling the “don’t do it cause we want to do it” line.

    Open source communities are flawed in design. There is no inherent drive or motivation to contribute to furthering the project. Look at the bakery. For the thousands of people who download and use CakPHP they are lucky to get 2 *decent* articles a week. I want to make CakeCollab into that community where people feel rewarded for their contributions (even if that means money out of my pocket).

    I am not trying to start a turf war but at the same time I am not going to be snubbed out and deny the many programmers out there possibly a great resource (wiki, hosting, pre-made packages, etc). Maybe I need to rename the site to remove “cake” to make the site more generic so I don’t get some trademark infringement letter in my mailbox :)

  • cakebaker

    Just build it, dammit :) Whether the Cake Foundation welcomes it or not. It is a good idea and worth to be realized. And a bit of competition is usually not bad ;-)

  • http://tariquesani.net/

    @Brandon – The CakePHP logo and name are also governed by fair use law and as far as my understanding of the law goes – things like your site, writing a book (about CakePHP) will be fair use as long as the TM is acknowledged.

  • Brandon

    Thank you guys for your support!!!
    I still have every desire to get this site happening and not getting the support of the foundation was more surprising than anything! I think they carry the notion that you are either with them or against them (or as it seems to me). The site will be centered around the framework but also branch off into other areas.

    @Tarique: I spent the last few days researching what exactly “Trademarks” are and you are somewhat correct in your statement. Trademarks are essentially a legal way to keep ownership over a name/identity. Which means I can’t (in any way) depict that I AM CakePHP or the site is derived as a part of the foundation.

    Using their logo would, in theory, be against the fair use because people would assimilate ownership of the site directly with the foundation (although i had that much common sense already … never wanted to use their logo).

    Google all the site about Microsoft products .. all the forums, wikis, code snips, etc that are dedicated to that OS. If it were against the law to use their name I’m sure MS would be busting down some doors a long time ago.

    So, all in all I will get the details out sometime this weekend and would love to open a discussion about any features you guys would like to see.

  • http://tariquesani.net/

    Well it would be much simpler if Cake Foundation made it clear what was allowed and what was not, quoting proper laws and reasons on their website – the best I have seen are pointers to some threads on the group with hardly any explanation.

  • Tracy Floyd

    I don’t see the point of quenching the community like this.

    I mean, we all agree that CakePHP is awesome… So, why are people snubbed out when they get excited about it and do things like this site? We build websites. It’s what we do. Its how we express ourselves. We love cake and want to help the community… that comes out in doing what we do… websites! We want to make sure it sticks around, etc. etc. The way I see it — it can only HELP the adoption of CakePHP… thereby helping everyone, including the Cake Foundation. I just hope stuff like this doesn’t end up hurting the community in the long run.

  • cakebaker

    @Tracy: I agree with you.

  • Jarrod

    Diagram missing?

  • cakebaker

    @Jarrod: Yes, you are right, this diagram no longer exists. I added a link to a similar diagram in the cookbook. Thanks for the hint!

© daniel hofstetter. Licensed under a Creative Commons License