Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 1256 Vote(s) - 3.48 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What are the differences between dpm() and dsm()?

#1
What are the differences between [`dpm()`][1] and [`dsm()`][2]?


[1]:

[To see links please register here]

[2]:

[To see links please register here]

Reply

#2
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.
Reply

#3
[`drupal_set_message()`][1] 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()`][2] function in the [Devel][3] module, which is short for "drupal print message" that outputs variables for development debugging.


[1]:

[To see links please register here]

[2]:

[To see links please register here]

[3]:

[To see links please register here]

Reply

#4
[`dsm()`][1] is legacy function. It's a call to [`dpm()`][2] as it is, so you should use `dpm()`.


[1]:

[To see links please register here]

[2]:

[To see links please register here]

Reply

#5
[Devel Demo][1] is a good drupal module that demonstrate the most of the debugging functions provided by devel module and [here][2] is a good post which gives a brief overview of those functions.


[1]:

[To see links please register here]

[2]:

[To see links please register here]

Reply

#6
They're all the same, check how [`dsm()`][1] 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.

[1]:

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through