You are here

function phantomjs_capture_requirements in PhantomJS Capture 7

Same name and namespace in other branches
  1. 8 phantomjs_capture.install \phantomjs_capture_requirements()

Implements hook_requirements().

Parameters

$phase:

Return value

array

File

./phantomjs_capture.install, line 18

Code

function phantomjs_capture_requirements($phase) {
  $requirements = [];
  $enabled = _is_exec_enabled();
  $url = "http://php.net/manual/en/function.exec.php";
  if ($enabled) {
    $message = t('The !url command is available.', [
      '!url' => l('exec()', $url),
    ]);
  }
  else {
    $message = t('The !url command is not available or the user has no permission to use it, you will be unable to use the phantomjs binary.', [
      '!url' => l('exec()', $url),
    ]);
  }
  $requirements['phantomjs_capture'] = [
    'title' => t('PhantomJS Capture'),
    'value' => $message,
    'severity' => $enabled ? REQUIREMENT_OK : REQUIREMENT_ERROR,
  ];
  return $requirements;
}