Reputation: 149014
What are the differences between dpm()
and dsm()
?
Upvotes: 27
Views: 19644
Reputation: 166755
They're all the same, check how dsm()
is defined (one is calling another):
function dsm($input, $name = NULL) {
return dpm($input, $name);
}
So the main one which should be used is dpm()
, as dsm()
is deprecated.
Upvotes: 3
Reputation: 5749
Devel Demo is a good drupal module that demonstrate the most of the debugging functions provided by devel module and here is a good post which gives a brief overview of those functions.
Upvotes: 0
Reputation: 5128
dsm()
is legacy function. It's a call to dpm()
as it is, so you should use dpm()
.
Upvotes: 6
Reputation: 3550
drupal_set_message()
is a Drupal core function that sets messages to be output on the next page view. drupal_print_message()
is, I believe (based on the examples I found in Google), something people occasionally say by accident when they actually mean drupal_set_message()
, but not a real function.
Note: there is a dpm()
function in the Devel module, which is short for "drupal print message" that outputs variables for development debugging.
Upvotes: 3
Reputation: 601
dpm() prints a variable to the ‘message’ area of the page using drupal_set_message(). The output and compact and less likely to break the layout of your page.
From the devel docs:
A note from the devel module: dsm() is a legacy function that was poorly named; use dpm() instead, since the 'p' maps to 'print_r'.
I think we should trust the devel folks on that one.
Upvotes: 35