You are here

function opigno_lms_get_current_opigno_lms_release in Opigno LMS 3.x

Same name and namespace in other branches
  1. 8.2 opigno_lms.profile \opigno_lms_get_current_opigno_lms_release()
  2. 8 opigno_lms.profile \opigno_lms_get_current_opigno_lms_release()

Implements opigno_lms_get_current_opigno_lms_release().

Get current Opigno LMS release version.

Return string with current release version or FALSE.

1 call to opigno_lms_get_current_opigno_lms_release()
opigno_lms_check_opigno_lms_updates in ./opigno_lms.profile
Implements opigno_lms_check_opigno_lms_updates().

File

./opigno_lms.profile, line 112
Enables modules and site configuration for a opigno_lms site installation.

Code

function opigno_lms_get_current_opigno_lms_release() {
  $profile = \Drupal::installProfile();
  if ($profile != 'opigno_lms') {
    return FALSE;
  }
  $info = \Drupal::service('extension.list.module')
    ->getExtensionInfo($profile);
  if (!empty($info) && isset($info['version'])) {
    if (!isset($info['version'])) {
      \Drupal::logger('opigno_learning_path')
        ->notice(t('Opigno LMS version is undefined!'));
      return FALSE;
    }
    else {
      return $info['version'];
    }
  }
  return FALSE;
}