If you tired use some combination like this
var_dump($some);
die();
And want some more comfortable, or you can`t use debugger, and still want to see some intermediate data when using Ajax, this for You.
- Copy all files except docs to your magento project
- Login (and maybe relogin) into admin panel
- Configure this in your own way (based on your security needs or habits) Magento Admin -> System -> Configuration -> TOMMY -> Debug Info -> Custom Debug Info Settings
In your code put some like this:
Tommy_DebugInfo_Helper_Data::getMe()->addDebugOutput('Message section', 'My debug mess :)');
Then go to web browser and you`ll see there
In this example I use this configuration for module: "Force Include output, if get this param" set to "?showInfog" in admin section
$performance = Tommy_DebugInfo_Helper_Data::getMe();
$someArrayOrObject = new stdClass();
$someArrayOrObject->name='Home';
$someArrayOrObject->status=1;
$performance->addDirectOutput($someArrayOrObject, 'someArrayOrObject');
You`ll see in Chrome console your object
$performance->addPerformanceLog('sleep 5 sec');
sleep(5);
$performance->addPerformanceLog('sleep 5 sec', 'finish');
You`ll see in browser your data If you want some intermediate data for your large process
$performance->addPerformanceLog('sleep 5 sec');
sleep(3);
$performance->addPerformanceLog('sleep 5 sec', 'breakpoint');
sleep(2);
$performance->addPerformanceLog('sleep 5 sec', 'finish');
To check block caching is correct, you can use option in config part
- Frontend
- Special url postfix
- Session
It works like described in screen outputs above. You see data in the bottom of browser page. This mode not recomended for production environment.
Like "Frontend" but use additional get parameter. Without this parameter we`ll get default behavior for pages.
In browser special page: http://url your.web.site/debug_info you`ll see list of connection (requests) to site. Browse to link you need then see all data like in "Frontend" mode. This mode require magento cache, there placed all data, you can clear magento cache this lead to clear debugInfo`s data Result is
- Magento (tested only in 1.9)
- jQuery (and set path to it in cofiguration, tested in 1.10*)
- Browser (tested in Chrome and Mozilla)
- PHP (tested in 5.5, must work in 5.3)
I like use the module with Cache Viewer , also I offer use development environment in Magento:
server {
# .....
server_name site.test www.site.test;
root /var/www/site;
location / {
try_files $uri /index.php$is_args$args;
}
# .....
location ~ \.php$ {
include fastcgi_common;
fastcgi_param MAGE_IS_DEVELOPER_MODE 1; # enable dev mode
}
}
- nginx,
<VirtualHost *:80>
#
ServerName site.test
ServerAlias www.site.test
SetEnv MAGE_IS_DEVELOPER_MODE 1 # enable dev mode
#.......
- apache2; and in index.php type this
//.....
require_once $mageFilename;
if (isset($_SERVER['MAGE_IS_DEVELOPER_MODE'])) {
Mage::setIsDeveloperMode(true);
Varien_Profiler::enable(); // from profiler debugInfo get data
ini_set('display_errors', 1);
}
//.....