5.x-1.x devel.module | drupal_debug($data, $label = NULL) |
6.x-1.x devel.module | drupal_debug($data, $label = NULL) |
7.x-1.x devel.module | drupal_debug($data, $label = NULL) |
1 call to drupal_debug()
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;
}
}
来自 https://api.drupal.org/api/devel/devel.module/function/drupal_debug/6.x-1.x