MDL-55980 Scheduled tasks: Run individual scheduled tasks from web

This commit is contained in:
sam marshall 2016-09-26 17:37:04 +01:00
parent 0f59b6dd75
commit 38fa1ca558
10 changed files with 348 additions and 48 deletions

View file

@ -8735,8 +8735,13 @@ function address_in_subnet($addr, $subnetstr) {
* This ensures any messages have time to display before redirect
*/
function mtrace($string, $eol="\n", $sleep=0) {
global $CFG;
if (defined('STDOUT') && !PHPUNIT_TEST && !defined('BEHAT_TEST')) {
if (isset($CFG->mtrace_wrapper) && function_exists($CFG->mtrace_wrapper)) {
$fn = $CFG->mtrace_wrapper;
$fn($string, $eol);
return;
} else if (defined('STDOUT') && !PHPUNIT_TEST && !defined('BEHAT_TEST')) {
fwrite(STDOUT, $string.$eol);
} else {
echo $string . $eol;