You are here

function upgrade_rector_requirements in Upgrade Rector 8

Implements hook_requirements().

File

./upgrade_rector.install, line 18
Install, update, and uninstall functions for the Upgrade Rector module.

Code

function upgrade_rector_requirements($phase) {
  $requirements = array();
  if (in_array($phase, [
    'install',
    'runtime',
  ])) {
    $message = t('Available');
    $severity = REQUIREMENT_OK;
    $description = '';
    if (!function_exists('exec')) {
      $message = t('Disabled');
      $description = t('The exec() PHP function is disabled. Upgrade Rector is unable to work without that.');
      $severity = REQUIREMENT_ERROR;
    }
    $requirements['upgrade_rector'] = array(
      'title' => t('PHP exec()'),
      'value' => $message,
      'severity' => $severity,
      'description' => $description,
    );
  }
  return $requirements;
}