You are here

function opigno_lms_requirements in Opigno LMS 8.2

Same name and namespace in other branches
  1. 8 opigno_lms.install \opigno_lms_requirements()
  2. 3.x opigno_lms.install \opigno_lms_requirements()

Implements hook_requirements().

File

./opigno_lms.install, line 81
Install, update and uninstall functions for the "opigno_lms" installation profile.

Code

function opigno_lms_requirements($phase) {
  $requirements = [];

  // Test if the Private File System Path is set.
  if ($phase == 'runtime') {
    $file_private_path_base_path = PrivateStream::basePath();
    if ($file_private_path_base_path === NULL) {
      $requirements['file_private_system'] = [
        'title' => 'Private Files System',
        'value' => t('Private file system path not set'),
        'severity' => REQUIREMENT_ERROR,
        'description' => t('Your uploaded files are not fully protected because you did not set a Private File Directory.
                          You need to set an existing local file system path for storing private files.
                          It should be writable by Drupal and not accessible over the web. This must be changed in settings.php.
                          More info: https://opigno.atlassian.net/wiki/spaces/OUM20/pages/743636993/Enable+private+file+system'),
      ];
    }
    else {
      $requirements['file_private_system'] = [
        'title' => 'Private Files System',
        'value' => t('Private file system path is set'),
        'severity' => REQUIREMENT_OK,
      ];
    }
  }
  return $requirements;
}