Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a PHP IDE that can handle Magento's code base?

Tags:

php

ide

magento

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 its 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.

like image 224
Laizer Avatar asked Feb 07 '10 10:02

Laizer


2 Answers

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

like image 156
Joe Mastey Avatar answered Nov 15 '22 16:11

Joe Mastey


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();
like image 21
Shane Stillwell Avatar answered Nov 15 '22 16:11

Shane Stillwell