From c667e6064ade1420a0dccfd9d50e17ccd602e1d2 Mon Sep 17 00:00:00 2001 From: cescobedo Date: Mon, 30 Mar 2020 09:55:32 +0200 Subject: [PATCH] MDL-68285 core_h5p: Fix unused variables and undeclared globals --- h5p/classes/core.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/h5p/classes/core.php b/h5p/classes/core.php index 3c15d85719d..6b0c3a4c24c 100644 --- a/h5p/classes/core.php +++ b/h5p/classes/core.php @@ -146,7 +146,6 @@ class core extends \H5PCore { public static function get_scripts(): array { global $PAGE; - $factory = new factory(); $jsrev = $PAGE->requires->get_jsrev(); $urls = []; foreach (self::$scripts as $script) { @@ -224,10 +223,6 @@ class core extends \H5PCore { public function fetch_content_type(array $library): ?int { $factory = new factory(); - // Get a temp path to download the content type. - $temppath = make_request_directory(); - $tempfile = "{$temppath}/" . $library['machineName'] . ".h5p"; - // Download the latest content type from the H5P official repository. $fs = get_file_storage(); $file = $fs->create_file_from_url( @@ -287,6 +282,8 @@ class core extends \H5PCore { * - array contentTypes: an object for each H5P content type with its information */ public function get_latest_content_types(): \stdClass { + global $CFG; + $siteuuid = $this->get_site_uuid() ?? md5($CFG->wwwroot); $postdata = ['uuid' => $siteuuid];