function fpm
Search API
| 7.x misc.inc | fpm($var, $max_levels = 15) |
| 6.x misc.inc | fpm($var, $max_levels = 20) |
| 5.x misc.inc | fpm($var, $max_levels = 20) |
Uses fp_add_message, but in this case, it also adds in the filename and line number which the message came from!
Most useful for developers, tracking down issues. It's also only visible to administrators with the "view_fpm_debug" permission. So if you need to display a message only to admins, you can use fpm() as a shortcut.
Note: If you attempt to fpm() an array or object with too many levels of nesting, it may run out of memory and your script will die.
44 calls to fpm()
- admin.module in modules/
admin/ admin.module - The administrative configurations for FlightPath.
- admin_apply_draft_changes_perform_batch_operation in modules/
admin/ admin.module - admin_display_main in modules/
admin/ admin.module - This is the "main" page for the admin module. It's what the user first sees when the click to go to the Admin page.
- advise.module in modules/
advise/ advise.module - advise_display_popup_group_select in modules/
advise/ advise.module
File
- includes/
misc.inc, line 2780 - This file contains misc functions for FlightPath
Code
function fpm($var, $max_levels = 15) {
if (!user_has_permission("view_fpm_debug")) {
return;
}
// Complex variable? Change it to print_r.
$str = $var;
if (is_array($str) || is_object($str)) {
$str = "<div class='fp-html-print-r-wrapper'>" . fp_html_print_r($str, "", 0, $max_levels) . "</div>";
}
$arr = debug_backtrace();
//pretty_print($arr);
$t = 0;
if (@$arr [1]['function'] == 'fpmct') {
$t = 1;
}
$file = $arr [$t]["file"];
if (strlen($file) > 70) {
$file = "..." . substr($file, strlen($file) - 70);
}
$str .= "<div class='fp-message-backtrace'>line {$arr [$t]["line"]}: $file</div>";
fp_add_message("• " . $str);
}
