Merge branch 'master' into file-storage-interface
commit
a65625d123
|
@ -130,18 +130,19 @@ interface H5PFrameworkInterface {
|
||||||
public function getAdminUrl();
|
public function getAdminUrl();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get id to an existing library
|
* Get id to an existing library.
|
||||||
|
* If version number is not specified, the newest version will be returned.
|
||||||
*
|
*
|
||||||
* @param string $machineName
|
* @param string $machineName
|
||||||
* The librarys machine name
|
* The librarys machine name
|
||||||
* @param int $majorVersion
|
* @param int $majorVersion
|
||||||
* The librarys major version
|
* Optional major version number for library
|
||||||
* @param int $minorVersion
|
* @param int $minorVersion
|
||||||
* The librarys minor version
|
* Optional minor version number for library
|
||||||
* @return int
|
* @return int
|
||||||
* The id of the specified library or FALSE
|
* The id of the specified library or FALSE
|
||||||
*/
|
*/
|
||||||
public function getLibraryId($machineName, $majorVersion, $minorVersion);
|
public function getLibraryId($machineName, $majorVersion = NULL, $minorVersion = NULL);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get file extension whitelist
|
* Get file extension whitelist
|
||||||
|
@ -805,12 +806,12 @@ class H5PValidator {
|
||||||
}
|
}
|
||||||
if ($valid) {
|
if ($valid) {
|
||||||
if ($upgradeOnly) {
|
if ($upgradeOnly) {
|
||||||
// When upgrading, we opnly add allready installed libraries,
|
// When upgrading, we only add the already installed libraries, and
|
||||||
// and new dependent libraries
|
// the new dependent libraries
|
||||||
$upgrades = array();
|
$upgrades = array();
|
||||||
foreach ($libraries as $libString => &$library) {
|
foreach ($libraries as $libString => &$library) {
|
||||||
// Is this library already installed?
|
// Is this library already installed?
|
||||||
if ($this->h5pC->getLibraryId($library, $libString) !== FALSE) {
|
if ($this->h5pF->getLibraryId($library['machineName']) !== FALSE) {
|
||||||
$upgrades[$libString] = $library;
|
$upgrades[$libString] = $library;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue