8

I looked for ideas on setting up a Magento development environment when we first started using it for our site last year. I didn't find anything that work really well, so I stayed with var_dump'ing using the log files.

Now that Magento has another year under its belt and several hundred more developers I was wondering if anyone has found a better solution for debugging Magento.

We use Eclipse as our development environment. We tried a pre-2.0 release of PDT with the Zend Debugger and didn't have much luck.

1
  • Has anyone used Zend Server CE? Commented Nov 25, 2009 at 13:48

7 Answers 7

6

How about using FirePHP?

http://ajzele.net/utilize-firebug-and-firephp-to-speed-up-magento-development

It made my life a hell of a lot easier.

Sign up to request clarification or add additional context in comments.

3 Comments

I'm giving this the "Answer Flag" because of the effort/reward of getting Firephp up and running. I am going to deep dive the xDebug environment a try when I get some time.
Hi, I tried it today and the link is broken, any alternatives?
Some Comments: Fire php should be enabled (of course) and the site you want to debug from Firephp (blue bug) -> Allowed sites menu. Also after copying the function some apostrophe (`) characters should become double quotes("). Thanx!
4

I use a combination of var_dump with xDebug and Magento's Mage::Log method. Mage::Log is particularly nice, as it'll do some auto-expanding and pretty printing of objects if you pass them in (I'm not sure if that's the logger, or just Magento's __toString implementation).

If I'm on my local development box I use Console.app to keep an eye on the log file, otherwise it's a simple

tail -f /path/to/log/file

That combined with some custom modules I've built for debugging the config and layout keep me happy. (although I prefer a light weight text editor toolchain vs. the One True IDE tool chain, so your results may vary)

2 Comments

Do you MAMP or other "all-in-one" AMP stack? I use MAMP, but will switch if it's easier to setup xDebug.
The Zend Framework is just a PHP Library, xDebug plays fine with it (you might be thinking of the Zend Platform)
3

logging $object->getData() rather than the $object itself is normally more useful, and everything built into Magento has it as a method (everything extends Varien_Object)

Comments

1

$object->debug() is often quite helpful too, although it doesn't exist on all objects. Here are my most commonly logged statements:

Mage::log( $object->debug() )
Mage::log( $object->getData() )
Mage::log( get_class($object) )           # name of class
Mage::log( get_class_methods($object) )   # methods of class

1 Comment

I used your tip to plug krumo() in, and found that I got the items I need off the object by using get_object_vars().
0

I also use FirePHP but find this extension easier.

Comments

0

Give it a try to Magneto-Debug: https://github.com/madalinoprea/magneto-debug (only for dev environments).

Video doesn't contain features added in the latest version: http://www.youtube.com/watch?v=aqvgrmebcu4 - display layout updates from DB - display blocks' rendering time

Comments

0

NuSphere is also good debugger for magento here is link NuSphere

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.