2017 © Pedro Peláez
 

magento-module debug-info

Magento module for convenient debugging and performance information

image

tommy/debug-info

Magento module for convenient debugging and performance information

  • Wednesday, April 29, 2015
  • by tomfun1990@gmail.com
  • Repository
  • 1 Watchers
  • 2 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

debugInfo - lightweight module for Magento

Alternative way to control your web application: debug, dump variables and measure performance

If you tired use some combination like this, (*1)

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., (*2)

Installation

  • 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

Usage

echo

In your code put some like this:, (*3)

Tommy_DebugInfo_Helper_Data::getMe()->addDebugOutput('Message section', 'My debug mess :)');

Then go to web browser and you`ll see there Image of output, (*4)

In this example I use this configuration for module: "Force Include output, if get this param" set to "?showInfog" in admin section, (*5)

var_dump

$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 Image of output, (*6)

Time measure

$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, (*7)

$performance->addPerformanceLog('sleep 5 sec');
sleep(3);
$performance->addPerformanceLog('sleep 5 sec', 'breakpoint');
sleep(2);
$performance->addPerformanceLog('sleep 5 sec', 'finish');

Image of output, (*8)

Compare cached blocks with real render

To check block caching is correct, you can use option in config part, (*9)

Work modes

  • Frontend
  • Special url postfix
  • Session

Frontend

It works like described in screen outputs above. You see data in the bottom of browser page. This mode not recomended for production environment., (*10)

Special url postfix

Like "Frontend" but use additional get parameter. Without this parameter we`ll get default behavior for pages., (*11)

Session

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 Image of output Result is, (*12)

Requirements

  • 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)

Recomend

I like use the module with Cache Viewer , also I offer use development environment in Magento:, (*13)

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,, (*14)

<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, (*15)

//.....
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);
}
//.....

The Versions

29/04 2015

dev-master

9999999-dev

Magento module for convenient debugging and performance information

  Sources   Download

MIT

The Requires

 

by Grigory Kotov

debug cache block magento var_dump varien_profiler