unexpected[it]

Professional IT Blog

  • 14th, Jun 2010

PHP Magento Debug

Tags: , ,

//Print all methods
echo '<ul>';
	foreach (get_class_methods(get_class($this)) as $cThis)
		echo '<li>' . $cThis . '</li>';
echo '</ul>';
//Force an error and get info
throw new Exception("".print_r($array_or_classes,true));
//Print info from objects
var_export(array_keys( $array ))
//Print attributes
print_r($customer->debug());

/**
* Debug SQL Queries - Log queries in a file
*
*/
// Modify this function: /lib/Varien/Db/Adapter/Pdo/Mysql.php
// Note: the debug file will be in /var/debug/sql.txt
// File: /lib/Varien/Db/Adapter/Pdo/Mysql.php
protected $_debug               = true;
protected $_logAllQueries       = true; 

© 2010 unexpected[it]. All Rights Reserved.

This blog is powered by Wordpress and a modified version of Magatheme