tags:

views:

640

answers:

5

Magento has a large code base (6000+ php files), uses a complex autoloading logic, and has a lot of configuration in XML. I'm looking for an IDE that can get it's little brain around this code base - show me where a function is declared, where it's called, etc. Is there any IDE that can handle this beast?

EDIT - Adding examples

Here's an example of how to load a product the Magento way:

 $product = Mage::getModel('catalog/product')->load($productID)

Getting a helper class looks similar:

 $helper = Mage::getHelper('catalog/product')

Additionally, the getters and setters of attributes are often assumed from the model, which may very well have been declared in an XML file somewhere, rather than in code.

+4  A: 

This is going to be down to two factors: IDE smartness (Is it going to recognize all the autoloaded classes?) and plain performance (How long does it take the IDE to walk through the file tree to build a lookup lexicon? How often is it going to refresh?)

Whether an IDE can handle those amounts of files depends strongly on how your machine is equipped. I recommend you go through the trial versions of the most popular PHP IDE's, and look which one suits you best. It should be quite easy to find out whether you can work with them or not.

I for one work with Nusphere's phpEd (14-day Trial here). I have never worked with that large a project, but big ones and I'm satisfied with the code lookup functionality. Like probably most IDE's, it allows manual addition of includes in case it misses an autoload.

Then there's Zend Studio (Download here) and Eclipse PDT (here), and a whole lot more to look at in this question. Not all of them do Code Completion for PHP, so you'll have to pick out those that do.

Pekka
im using eclipse with PDT and it functions rather efficiently
MANCHUCK
A: 

I've used Netbeans to work on large PHP projects (it also handles large Java and C projects). My current CakePHP projects has 35000 files, 4000-5000 of them are PHP files including external libraries etc.

The IDE is responsive for some time, but if you keep it running overnight the IDE becomes sluggish and you need to restart it.

matiasf
+2  A: 

If you are going for a free IDE, then Eclipse PDT will work just fine. It can handle all those files without problem. If you want a more full-featured IDE, I would choose Zend Studio. Zend Studio is essentially Eclipse PDT with additional features (like a really nice debugger/profiler built into a browser toolbar, and better code formatting out of the box).

mylesmg
I'm working with PDT now, and it appears to be totally clueless about the autoloading funkiness of Magento. How would I enlighten it?
Laizer
Try adding the path to Magento in your libraries for the project.
mylesmg
+4  A: 

Probably not the answer you want, but the number of files probably won't be your foil here. Since Magento uses strange methods to instantiate objects (Mage::getModel etc), normal code completion is completely at a loss. On top of that, Magento makes heavy use of PHP's magic functions, which of course are totally exempt from code completion.

I've worked with a few IDEs using Magento (Komodo, Zend Studio, Eclipse), and I've never had a very good result. Komodo was the only one that didn't have a coronary trying to guess, so I've been using that for some time now.

Hope that helps. Thanks!

Joe

Joseph Mastey
+2  A: 

A Netbeans fan myself. What you are looking for is Class Type Hints that both Zend Studio and Nebeans support. Magento has been slow in setting these, but there are some occasions of it in the code.

http://files.zend.com/help/Zend-Studio-7/code_assist_concept.htm

 /* @var $myVar TestClass */
 $myVar = new getClass();
nvoyageur