HFJ-59: Renamed coreVersion to coreApi.

Removes annoying double naming (coreVersion.majorVersion become coreApi.majorVersion)
Explicitly states that the versioning is one the API.
Explicitly states that this is the core version. (apiVersion could mean API of the library)
namespaces
Frank Ronny Larsen 2013-12-05 12:15:14 +01:00
parent 6bb9c9a9b6
commit b7f14a4c44
1 changed files with 9 additions and 9 deletions

View File

@ -325,7 +325,7 @@ class H5PValidator {
'h' => '/^[0-9]{1,4}$/', 'h' => '/^[0-9]{1,4}$/',
'embedTypes' => array('iframe', 'div'), 'embedTypes' => array('iframe', 'div'),
'fullscreen' => '/^(0|1)$/', 'fullscreen' => '/^(0|1)$/',
'coreVersion' => array( 'coreApi' => array(
'majorVersion' => '/^[0-9]{1,5}$/', 'majorVersion' => '/^[0-9]{1,5}$/',
'minorVersion' => '/^[0-9]{1,5}$/', 'minorVersion' => '/^[0-9]{1,5}$/',
), ),
@ -656,17 +656,17 @@ class H5PValidator {
// Test library core version requirement. If no requirement is set, // Test library core version requirement. If no requirement is set,
// this implicitly means 1.0, which shall work on newer versions // this implicitly means 1.0, which shall work on newer versions
// too. // too.
if (isset($h5pData['coreVersion']) && !empty($h5pData['coreVersion'])) { if (isset($h5pData['coreApi']) && !empty($h5pData['coreApi'])) {
if (($h5pData['coreVersion']['majorVersion'] > H5PCore::$coreVersion['majorVersion']) || if (($h5pData['coreApi']['majorVersion'] > H5PCore::$coreApi['majorVersion']) ||
(($h5pData['coreVersion']['majorVersion'] == H5PCore::$coreVersion['majorVersion']) && (($h5pData['coreApi']['majorVersion'] == H5PCore::$coreApi['majorVersion']) &&
($h5pData['coreVersion']['minorVersion'] > H5PCore::$coreVersion['minorVersion']))) ($h5pData['coreApi']['minorVersion'] > H5PCore::$coreApi['minorVersion'])))
{ {
$this->h5pF->setErrorMessage( $this->h5pF->setErrorMessage(
$this->h5pF->t('The library "%library_name" requires H5P %requiredVersion, but only H5P %coreVersion is installed.', $this->h5pF->t('The library "%library_name" requires H5P %requiredVersion, but only H5P %coreApi is installed.',
array( array(
'%library_name' => $library_name, '%library_name' => $library_name,
'%requiredVersion' => $h5pData['coreVersion']['majorVersion'] . '.' . $h5pData['coreVersion']['minorVersion'], '%requiredVersion' => $h5pData['coreApi']['majorVersion'] . '.' . $h5pData['coreApi']['minorVersion'],
'%coreVersion' => H5PCore::$coreVersion['majorVersion'] . '.' . H5PCore::$coreVersion['minorVersion'] '%coreApi' => H5PCore::$coreApi['majorVersion'] . '.' . H5PCore::$coreApi['minorVersion']
))); )));
$valid = false; $valid = false;
} }
@ -1224,7 +1224,7 @@ Class H5PExport {
* Functions and storage shared by the other H5P classes * Functions and storage shared by the other H5P classes
*/ */
class H5PCore { class H5PCore {
public static $coreVersion = array( public static $coreApi = array(
'majorVersion' => 1, 'majorVersion' => 1,
'minorVersion' => 0 'minorVersion' => 0
); );