Skip to content

nWire experience (in PHP)

Looking to the PHP codebase you inherited is not the very best task a developer can imagine. All those dynamics can make one looking for variables or objects without knowing where it all came from or what is the path included.
Having myself such an experience, I was looking for a tool to help me connect all the dots in newly experienced code base I had been given. I needed a ‘thing’ to go through all the code in current project, search and relate the classes and files across the project scope.

One again I turned to “PHP via Java” search. Lot of stuff that Java has, already is or can be implemented for PHP. Lot of tools for PHP (such as PHPDoc, Phing…) are counterparts of well known tools for Java (JavaDoc, Ant…). So, I was looking in that direction…
For code analysis and visualization I have been given hint to look at nWire (for PHP, that is) some month or two ago. As I am using Eclipse PDT installing nWire was a breeze and as with most other plug-ins, this was just as simple to start using it.

nWire enabled me (in real-time) to look at variable related context (reading, changing, inheritance, other files..) in a way I couldn’t imagine before. This is really nice if you got 100K+ lines of code without knowing much about it, but must to do something with it. In just few hours one can get understanding of the code relation and with help of other tools (xdebugger & kcachegrind) getting to know your code is just more fun than before.

The great thing is that one can see instantly where selected variable is being read or modified. And with just a click you can see the exact line. In dynamic languages such as PHP, this is enormous help, especially on project where the code is not, … you know… pure…

Event better, see you code!

Visualizer helps you visualize code relations in context of classes, inheritance, includes/requires with nicely looking graphs.

The down-side of nWire is that is requires some CPU power at the start (to build repository, see their site for details) and sometimes it can be a performance hit, but I am sure they work hard on resolving these issues with future releases. If it bothers you, disable nWire support for a while (after building repository) and later enable it as you move along with your project. I did this while debugging some more complex stuff to save my CPU clocks, but just because I was in a hurry to finish the code that day.
I haven’t test nWire for Java (yet) so I can really compare if the tool is more performant for Java. I reckon it could be, as with PHP you must look for a type for yourself, but I don’t know really details of implementation (the tool is NOT open source :( ). I know they let the PDT do type resolving, but that is my limit at this moment.
Even with a little performance issues, from now on, I am sure nothing could replace it in my growing arsenal of SD tools.
See more details at: nWire for PHP (

Posted in development. Tagged with , , , .

0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

Some HTML is OK


(required, but never shared)

or, reply to this post via trackback.