You are here

function background_process_requirements in Background Process 8

Same name and namespace in other branches
  1. 6 background_process.install \background_process_requirements()
  2. 7 background_process.install \background_process_requirements()

Implements hook_requirements().

File

./background_process.install, line 85
This is the installation file for the Background Process module.

Code

function background_process_requirements($phase) {
  $response = [];
  $t = 't';
  switch ($phase) {
    case 'install':
      return $response;
    case 'runtime':
      $response['title'] = 'Background Process';
      $response['value'] = $t('OK');
      $response['severity'] = REQUIREMENT_OK;
      if (ini_get('safe_mode')) {
        $desc = $t('Safe mode enabled. Background Process is unable to control maximum execution time for background processes. This may cause background processes to end prematurely.');
        if ($response['severity'] < REQUIREMENT_WARNING) {
          $response['severity'] = REQUIREMENT_WARNING;
          $response['value'] = $t('Safe mode enabled');
          $response['description'] = $desc;
        }
        else {
          $response['description'] .= '<br/>' . $desc;
        }
      }
      $result = [];
      $result['background_process'] = $response;
      return $result;
  }
}