Return to Snippet

Revision: 35530
at November 10, 2010 02:22 by dmistriotis


Updated Code
/**
*
* @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
*/
ob_start();
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
*/
$channel->flush();
$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. */

Revision: 35529
at November 10, 2010 02:21 by dmistriotis


Updated Code
/**
*
* @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: �LOG�, �INFO�, �WARN�, �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
*/
ob_start();
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
*/
$channel->flush();
$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. */

Revision: 35528
at November 10, 2010 02:20 by dmistriotis


Initial Code
/**
*
* @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: ‘LOG’, ‘INFO’, ‘WARN’, ‘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
*/
ob_start();
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
*/
$channel->flush();
$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. */

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

Initial Description
nice post, would do it a bit differently but using it currently as-is.

Initial Title
Attach FirePHP to magento

Initial Tags
php, magento

Initial Language
PHP