Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
|
Print an error to STDOUT and exit with a non-zero code. More...
Functions | |
mdie ($msg='', $errorcode=1) | |
Variables | |
$fh | |
$stdin = fopen('php://stdin', 'r') | |
if(!file_exists(__DIR__.'/mailout-debugger.enable')) | $tmpdir =sys_get_temp_dir() |
if(isset( $_SERVER[ 'REMOTE_ADDR'])) if(isset($_ENV['TMPDIR']) &&is_dir($_ENV['TMPDIR'])) | $tmpfile = $tmpdir . '/moodle-mailout.log' |
Print an error to STDOUT and exit with a non-zero code.
For commandline scripts. Default errorcode is 1.
Very useful for perl-like error-handling:
do_something() or mdie("Something went wrong");
string | $msg | Error message |
integer | $errorcode | Error code to emit |