function fpm
Search API
7.x misc.inc | fpm($var, $max_levels = 20) |
6.x misc.inc | fpm($var, |
4.x misc.inc | fpm($var) |
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.
13 calls to fpm()
- 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_display_popup_group_select in modules/
advise/ advise.module - course_search_download_syllabus in modules/
course_search/ course_search.module - This function will actually deliver a syllabus to the user's browser for download.
- depricated_message in includes/
misc.inc - Displays a depricated message on screen. Useful for tracking down when depricated functions are being used.
- _AdvisingScreen::display_group in classes/
_AdvisingScreen.php - This function displays a Group object on the degree plan. This is not the selection popup display. It will either show the group as multi rows, filled in with courses, or as a "blank row" for the user to click on.
File
- includes/
misc.inc, line 1149 - This file contains misc functions for FlightPath
Code
function fpm($var) {
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) . "</div>";
}
$arr = debug_backtrace();
//pretty_print($arr);
$file = $arr [0]["file"];
if (strlen($file) > 70) {
$file = "..." . substr($file, strlen($file) - 70);
}
$str .= "<div class='fp-message-backtrace'>line {$arr [0]["line"]}: $file</div>";
fp_add_message("• " . $str);
}