Efficiently gathering information about the inner workings of a new PHP project. Tools? Techniques? Scripts? Efficiently gathering information about the inner workings of a new PHP project. Tools? Techniques? Scripts? php php

Efficiently gathering information about the inner workings of a new PHP project. Tools? Techniques? Scripts?


I agreee that your question does have most of the answers.

This is what I would probably do.I would probably start with Sebastian Bergman's tools, especially phploc so you can get an idea of the scope of the mess (codebase) you are looking at. It gives you class, function counts, etc not just lines of code.

Next I would look in the apache logs or google analytics and get the top 10 most requested php url's. I'd setup XDebug with profiling and run through those top 10 requests and get the files, call tree. (You can view these with a cachegrinder tool)

Finally, I'd read through the entire execution path of 1 or two of those traces, that is most representative of the whole. I'd use my Eclipse IDE but print them out and go to town with a highlighter is valid as well.

The top 10 method might fail you if there are multiple systems cobbled together. You should see quickly with Xdebug whether the top 10 are coded similarliy are if each is a unique island.

I would look at the mysql databases and try to understand what they are all for, espacially looking at table prefixes, you may have a couple of different apps stacked on top of each other. If there are large parts of the db not touched by the top 10 you need to go hunting for the subapps. If you find other sub apps run them through the xdebug profiler and then read through one of the paths that is representative of that sub app.

Now go back and look at your scope numbers from phploc and see what percentage of the codebase (probably count classes, or functions) was untouched during your review.

You should have a basic understanding of the most often run code and and idea of how many nooks and crannies and closets for skeleton storage there are.


Perhaps you can set up a continuous integration enviroment. In this enviroment you could gather all the statistics you want.

Jenkins is a fine CI server with loads of plugins and documentation.


For checking problems which could be expected (duplicate code, potential bugs...), you could use some of those tools:

https://stackoverflow.com/questions/4202311/php-tools-for-quality-check

HTH

PS. I Have to say that your question, IMO, contains already a lot of great answers.