kutchbhi Posted March 3, 2014 Share Posted March 3, 2014 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 Quote Link to comment https://forums.phpfreaks.com/topic/286680-understanding-what-a-framework-is-doing-behind-the-scenes/ Share on other sites More sharing options...
kicken Posted March 4, 2014 Share Posted March 4, 2014 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. Quote Link to comment https://forums.phpfreaks.com/topic/286680-understanding-what-a-framework-is-doing-behind-the-scenes/#findComment-1471380 Share on other sites More sharing options...
kutchbhi Posted March 4, 2014 Author Share Posted March 4, 2014 Thanks that symphony link looks good. Other than that I found this explanation for routes and rewrites: http://programmers.stackexchange.com/a/122198 Quote Link to comment https://forums.phpfreaks.com/topic/286680-understanding-what-a-framework-is-doing-behind-the-scenes/#findComment-1471407 Share on other sites More sharing options...
kutchbhi Posted March 4, 2014 Author Share Posted March 4, 2014 hmm symphony is wayy to complex to start IMO. Any other frameworks that have documentation about their internals ? Quote Link to comment https://forums.phpfreaks.com/topic/286680-understanding-what-a-framework-is-doing-behind-the-scenes/#findComment-1471411 Share on other sites More sharing options...
trq Posted March 4, 2014 Share Posted March 4, 2014 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. Quote Link to comment https://forums.phpfreaks.com/topic/286680-understanding-what-a-framework-is-doing-behind-the-scenes/#findComment-1471422 Share on other sites More sharing options...
vinh014 Posted March 27, 2014 Share Posted March 27, 2014 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. Quote Link to comment https://forums.phpfreaks.com/topic/286680-understanding-what-a-framework-is-doing-behind-the-scenes/#findComment-1474074 Share on other sites More sharing options...
trq Posted March 27, 2014 Share Posted March 27, 2014 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. Quote Link to comment https://forums.phpfreaks.com/topic/286680-understanding-what-a-framework-is-doing-behind-the-scenes/#findComment-1474103 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.