From: Eloy Lafuente (stronk7) Date: Tue, 11 Oct 2016 09:54:23 +0000 (+0200) Subject: Merge branch 'MDL-55921' of https://github.com/mr-russ/moodle X-Git-Tag: v3.2.0-beta~328 X-Git-Url: http://git.moodle.org/gw?p=moodle.git;a=commitdiff_plain;h=537054ec274a7e1863e79dc55715845f358b6aff;hp=b65c33ace579887a3fae3d03cb3de2d38a546239 Merge branch 'MDL-55921' of https://github.com/mr-russ/moodle --- diff --git a/lib/xhprof/xhprof_moodle.php b/lib/xhprof/xhprof_moodle.php index 9a4f850d2d0..c930d4ff0e0 100644 --- a/lib/xhprof/xhprof_moodle.php +++ b/lib/xhprof/xhprof_moodle.php @@ -613,6 +613,13 @@ function profiling_import_runs($file, $commentprefix = '') { function profiling_export_generate(array $runids, $tmpdir) { global $CFG, $DB; + if (empty($CFG->release) || empty($CFG->version)) { + // Some scripts may not have included version.php. + include($CFG->dirroot.'/version.php'); + $CFG->release = $release; + $CFG->version = $version; + } + // Calculate the header information to be sent to moodle_profiling_runs.xml. $release = $CFG->release; $version = $CFG->version; @@ -865,7 +872,7 @@ class moodle_xhprofrun implements iXHProfRuns { $DB->insert_record('profiling', $rec); - if (PHPUNIT_TEST && !PHPUNIT_UTIL) { + if (PHPUNIT_TEST) { // Calculate export variables. $tempdir = 'profiling'; make_temp_directory($tempdir);