diff --git a/h5p.classes.php b/h5p.classes.php index 5c4d17e..99e54fa 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -180,7 +180,6 @@ interface H5PFrameworkInterface { */ public function saveLibraryUsage($contentId, $librariesInUse); - /** * Loads a library * @@ -193,6 +192,18 @@ interface H5PFrameworkInterface { */ public function loadLibrary($machineName, $majorVersion, $minorVersion); + /** + * Loads and decodes library semantics. + * + * @param string $machineName + * @param int $majorVersion + * @param int $minorVersion + * @return array|FALSE + * Array representing the library with dependency descriptions + * FALSE if the library doesn't exist + */ + public function getLibrarySemantics($machineName, $majorVersion, $minorVersion); + /** * Delete all dependencies belonging to given library * @@ -1398,8 +1409,7 @@ class H5PContentValidator { } else { $libspec = $this->h5pC->libraryFromString($value->library); - $library = $this->h5pF->loadLibrary($libspec['machineName'], $libspec['majorVersion'], $libspec['minorVersion']); - $librarySemantics = json_decode($library['semantics']); + $librarySemantics = $this->h5pF->getLibrarySemantics($libspec['machineName'], $libspec['majorVersion'], $libspec['minorVersion']); $semanticsCache[$value->library] = $librarySemantics; } $this->validateBySemantics($value->params, $librarySemantics);