The Krumo is based on the Krumo debug tool which is included with the Devel module.

It is designed to assist developers in debugging variables by providing a simple block that can be configured to display all of the elements of a given array or object. Krumo is an alternative to php's built-in print_r and var_dump functions.

Krumo will print out a stack of variables using css and dhtml in way that is more human readable than the alternatives.

Variables cab be added to a stack through a simple function call. The stack is in turn displayed in a block using Krumo to format the results.

Usage

Add a variable to the stack by calling krumo_add ( mixed $variable [, string $stack_name ] )

Parameters

variable: The string, array, or object to trace.

stack_name: The name of the stack that will be displayed in the output. (this is an optional parameter)

Examples

Calling krumo_add to trace your variable:

<?php
function my_function () {
 
// call krumo_add - pass my_variable as the variable and "my-variable" as the stack name.
 
krumo_add($my_variable,'my-variable');
}
?>

or

Calling krumo_add to trace your array:

<?php
function my_function () {
 
// call krumo_add - pass an in-line array as the variable and "my-array" as the stack name.
 
krumo_add(array('test_array' => array('one'=>1,'two'=>2)),'my-array'););
}
?>

Calling krumo_add from within hook_nodeapi:

<?php
function hook_nodeapi (&$node, $op) {
 
// call krumo_add - pass $node as the variable and $op as the stack name.
 
krumo_add($node, $op);
}
?>

Optional settings

In the block configuration you will find the following options:

backtrace: Show results of php debug_backtrace function.

includes: Show results of php get_included_files function.

functions: Show results of php get_defined_functions function.

classes: Show results of php get_declared_classes function.

defines: Show results of php get_defined_constants function.

path: Show results of php ini_get('include_path') function.

get: Show results of php $_GET variables.

post: Show results of php $_POST variables.

dependancies

Devel

Project Information

Downloads