MDL-62891 core: Stop using var_export() to describe callables

Make use of the newly added function get_callable_name() when reporting
that an exception happened during shutdown.
This commit is contained in:
David Mudrák
2018-10-05 09:10:16 +02:00
parent 905d02f458
commit 75ab4d2eb7
+2 -2
View File
@@ -80,10 +80,10 @@ class core_shutdown_manager {
call_user_func_array($callback, $params);
}
} catch (Exception $e) {
error_log('Exception ignored in shutdown function '.var_export($callback, true).':'.$e->getMessage());
error_log('Exception ignored in shutdown function '.get_callable_name($callback).': '.$e->getMessage());
} catch (Throwable $e) {
// Engine errors in PHP7 throw exceptions of type Throwable (this "catch" will be ignored in PHP5).
error_log('Exception ignored in shutdown function '.var_export($callback, true).':'.$e->getMessage());
error_log('Exception ignored in shutdown function '.get_callable_name($callback).': '.$e->getMessage());
}
}