You are here

function background_process_requirements in Background Process 7

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

Implements hook_requirements().

File

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

Code

function background_process_requirements($phase) {
  $response = array();
  $t = get_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 = array();
      $result['background_process'] = $response;
      return $result;
  }
}