function drupal_debug in Devel 6
Same name and namespace in other branches
- 5 devel.module \drupal_debug()
- 7 devel.module \drupal_debug()
1 call to drupal_debug()
- dd in ./
devel.module
File
- ./
devel.module, line 1830
Code
function drupal_debug($data, $label = NULL) {
ob_start();
print_r($data);
$string = ob_get_clean();
if ($label) {
$out = $label . ': ' . $string;
}
else {
$out = $string;
}
$out .= "\n";
// The temp directory does vary across multiple simpletest instances.
$file = file_directory_temp() . '/drupal_debug.txt';
if (file_put_contents($file, $out, FILE_APPEND) === FALSE) {
drupal_set_message(t('Devel was unable to write to %file.', array(
'%file' => $file,
)), 'error');
return FALSE;
}
}