/ Published in: PHP
nice post, would do it a bit differently but using it currently as-is.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/** * * @author Branko Ajzele * @license GPL * * @param object $var Object we wish to debug in FireBug * @param string $label Nice little label we wish to add so we can see it in FireBug * @param string $style String holding one of values: "INFO", "ERROR", "TRACE", "EXCEPTION" , "TABLE" * @return void Return null if Mage::setIsDeveloperMode(false) otherwise return message to browser */ function acl($var, $label, $style = "LOG") { if(Mage::getIsDeveloperMode()) { $request = new Zend_Controller_Request_Http(); $response = new Zend_Controller_Response_Http(); $channel = Zend_Wildfire_Channel_HttpHeaders::getInstance(); $channel->setRequest($request); $channel->setResponse($response); /* * Start output buffering */ Zend_Wildfire_Plugin_FirePhp::send($var, $label, $style); /* Style Description LOG Displays a plain log message INFO Displays an info log message WARN Displays a warning log message ERROR Displays an error log message that increments Firebug�s error count TRACE Displays a log message with an expandable stack trace EXCEPTION Displays an error long message with an expandable stack trace TABLE Displays a log message with an expandable table */ /* * Flush log data to browser */ $response->sendHeaders(); } else { return null; } } /* All you need to do is to place it inside the index.php file, the one inside the root Magento folder. You need to place it after Mage::setIsDeveloperMode(true); statement. Which by the way you need to uncomment (in development environment). That's it, your done. */
URL: http://ajzele.net/utilize-firebug-and-firephp-to-speed-up-magento-development