From abf6d1c3959cbaad328f515e6e05b5efb991d9ae Mon Sep 17 00:00:00 2001 From: Mihail Geshoski Date: Wed, 30 Oct 2019 15:21:57 +0800 Subject: [PATCH] MDL-67067 core_h5p: Load cached assets by default --- h5p/classes/core.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/h5p/classes/core.php b/h5p/classes/core.php index c855c2f822a0f..206f47cf3c65f 100644 --- a/h5p/classes/core.php +++ b/h5p/classes/core.php @@ -25,6 +25,7 @@ namespace core_h5p; use H5PCore; +use H5PFrameworkInterface; use stdClass; use moodle_url; @@ -41,6 +42,24 @@ class core extends \H5PCore { protected $libraries; + /** + * Constructor for core_h5p/core. + * + * @param H5PFrameworkInterface $framework The frameworks implementation of the H5PFrameworkInterface + * @param string|\H5PFileStorage $path The H5P file storage directory or class + * @param string $url The URL to the file storage directory + * @param string $language The language code. Defaults to english + * @param boolean $export Whether export is enabled + */ + public function __construct(H5PFrameworkInterface $framework, $path, string $url, string $language = 'en', + bool $export = false) { + + parent::__construct($framework, $path, $url, $language, $export); + + // Aggregate the assets by default. + $this->aggregateAssets = true; + } + protected function getDependencyPath(array $dependency): string { $library = $this->find_library($dependency);