Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
Moodle\H5PValidator Class Reference

This class is used for validating H5P files. More...

Public Member Functions

 __construct ($H5PFramework, $H5PCore)
 Constructor for the H5PValidator.
 
 getLibraryData ($file, $filePath, $tmpDir)
 Validates a H5P library.
 
 isValidPackage ($skipContent=FALSE, $upgradeOnly=FALSE)
 Validates a .h5p file.
 

Public Attributes

 $h5pC
 
 $h5pCV
 
 $h5pF
 

Detailed Description

This class is used for validating H5P files.

Constructor & Destructor Documentation

◆ __construct()

Moodle\H5PValidator::__construct ( $H5PFramework,
$H5PCore )

Constructor for the H5PValidator.

Parameters
H5PFrameworkInterface$H5PFrameworkThe frameworks implementation of the H5PFrameworkInterface
H5PCore$H5PCore

Member Function Documentation

◆ getLibraryData()

Moodle\H5PValidator::getLibraryData ( $file,
$filePath,
$tmpDir )

Validates a H5P library.

Parameters
string$fileName of the library folder
string$filePathPath to the library folder
string$tmpDirPath to the temporary upload directory
Return values
boolean|arrayH5P data from library.json and semantics if the library is valid FALSE if the library isn't valid

◆ isValidPackage()

Moodle\H5PValidator::isValidPackage ( $skipContent = FALSE,
$upgradeOnly = FALSE )

Validates a .h5p file.

Parameters
bool$skipContent
bool$upgradeOnly
Return values
boolTRUE if the .h5p file is valid TRUE if the .h5p file is valid

The documentation for this class was generated from the following file: