In the function drupal_debug() the output file is set to
$file = 'temporary://drupal_debug.txt';
However, I was wondering why it should be hard-coded, and would it be better to use
$file = file_directory_temp() . '/drupal_debug.txt';
With the hard-coded 'temporary:' I get an error when trying to use dd() during simpletest, saying that the wrapper 'temporary:' is unknown. If we used file_directory_temp() instead, then I can control where the output goes by using variable_set('file_temporary_path', '/my/tmp/path');
. Currently the simpletest temp directory is different for each run, so locating the debug.txt file is tricky.
Comment | File | Size | Author |
---|---|---|---|
#1 | 2202887_1.use_file_directory_temp.patch | 606 bytes | jonathan1055 |
Comments
Comment #1
jonathan1055 CreditAttribution: jonathan1055 commentedPatch against 7.x dev
Comment #2
pcambraThanks for the patch, could you try if it applies for 8.x? it should go there first.
Comment #3
jonathan1055 CreditAttribution: jonathan1055 commentedOK, I will check. The code is identical, but I am having difficulty finding the Devel config options in D8. I've enabled the module but cannot find it in the 'Configuration' page with the spanner. I have the four core 'development' items, but nothing from this module.
Comment #4
pcambraThanks @jonathan1055
Pushed to 7 & 8!
Comment #5
jonathan1055 CreditAttribution: jonathan1055 commentedExcellent, thank you. Cheers for giving authorship credit too.
Jonathan