Skip to content

Commit

Permalink
Merge branch 'MDL-55921' of https://github.com/mr-russ/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Oct 11, 2016
2 parents b65c33a + 8beee5a commit 537054e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/xhprof/xhprof_moodle.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -865,7 +872,7 @@ public function save_run($xhprof_data, $type, $run_id = null) {

$DB->insert_record('profiling', $rec);

if (PHPUNIT_TEST && !PHPUNIT_UTIL) {
if (PHPUNIT_TEST) {
// Calculate export variables.
$tempdir = 'profiling';
make_temp_directory($tempdir);
Expand Down

0 comments on commit 537054e

Please sign in to comment.