Jump to content

Archived

This topic is now archived and is closed to further replies.

kutchbhi

Understanding what a framework is doing behind the scenes.

Recommended Posts

My aim is to really understand what a framework does behind the scenes. Don't worry I am not trying to write my own, but I really want to understand a framework..

 

I tried going through the source of a few, and even though I understood what the individual lines were supposed to do, I couldn't quite get the 'logic' of the app. Any suggestions on how to 'read' code ? 

 

Any other resources that may help me in knowing how/what  framework does?

 

 

Thanks

 

Share this post


Link to post
Share on other sites

It can be hard to grasp a high-level concept from looking at just the code sometimes, it's generally best to look into the documentation for the framework for any explanations first. You can combine that then with going through the relevant code to get a better picture of not only what is being done but how it's being done.

 

Each framework is going to do things differently, so you should pick a single framework and work on learning that fairly well. Symfony has some pretty good documentation about it's internal workings that would make a good starting point.

 

A benefit also is to setup something like XDebug so that you can step through code as a request is processed to better follow it's path and see what is going on.

Share this post


Link to post
Share on other sites

hmm symphony is wayy to complex to start IMO. Any other frameworks that have documentation about their internals ?  

Share this post


Link to post
Share on other sites

Laravel is much simpler than Symfony, and while there docs generally suck, they do have a few paragraphs on the Request Lifecycle.

 

A great option when doing this sort of thing is to get yourself a decent PHP debugger and simply step through the process.

 

eg; to do so in Symfony, start by adding a breakpoint to https://github.com/symfony/symfony-standard/blob/master/web/app_dev.php#L28 and hitting the default route. Then step through a few times to see what happens.

Share this post


Link to post
Share on other sites

If the framework that you want to understand is built on php5.2 such as CackePHP 1 Zend 1, i recommend using xdebug to step through code.
i tried this way for framework base on php5.3 such as symfony2 but difficult.

Share this post


Link to post
Share on other sites

If the framework that you want to understand is built on php5.2 such as CackePHP 1 Zend 1, i recommend using xdebug to step through code.

i tried this way for framework base on php5.3 such as symfony2 but difficult.

xdebug works fine with >= php5.3, Im not sure what your issue is.

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.