What tool can I use to generate a PHP class usage report for my application?

I have a fairly large php 5 object oriented project and as part of an impact analysis I would like to compile a report on the use of every existing class in the whole project.

It would help me a lot if I could find an existing tool that will parse all the files in my project and generate some kind of report that lists, for example, all the object class names created for each class of the project and let me. at least it's easy and quick to find it.

Any help here would be appreciated!

+2


source to share


4 answers


Check out nWire for PHP . It analyzes your code and recognizes such associations. It's built as an interactive tool, not a reporting tool, but if you insist, you can still connect to your database (it uses H2 which is SQL compatible) and use an external reporting tool.



+2


source


IMO Zend has some profiling tools that do just that. Or, you can extrapolate this information from your accelerator log.



Or try this with XDEBUG

+2


source


Xdebug can track your code and generate code coverage statistics . There are additional tools like Spike PHPCoverage that can generate well-formatted reports, but since they are for testing purposes it will just give you a logical result (like a line of code is used or not used). You probably want a more verbose view (like how many times it is used).

Another option is to use the Xdebug tracing feature . This will give you a detailed report of the actual call schedule. You can determine which files have been used the most from this. You will need to write the data parser manually, but it shouldn't be too difficult.

Finally, you can do the same with a static call schedule. There are some tools available for php. Here are a few:

Again, you will probably need to do some additional manual parsing on the output of these tools to get something that is relevant to your use case.

+1


source


The smart guys at Particletree , the same people behind the functionally and aesthetically great Wufoo, often publish and release their PHP tools and utilities, most recently their PHP Quick Profiler . As you can probably tell, I have tremendous respect for these guys and love for what they do.

A good PHP profiler is often difficult, and PQP is by far the best I've come across. However, almost all the various application <structure href = "http://framework.zend.com/ rel =" nofollow noreferrer "> have some form of profiling system, humble or another, but not so deep and useful as PQP. However, I usually find that the framework profiling tools are more tightly coupled to the code, and if you are using standard framework libraries, you will have to do a lot less implementation with the profiling tool (this is definitely the case with CodeIgniter ). But if you need additional bit of power and flexibility, PQP works great.

Let me know if you find anything better - I would love to watch it!

Jamie

0


source







All Articles