You are here

function phantomjs_capture_requirements in PhantomJS Capture 8

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

Implements hook_requirements().

Parameters

$phase:

Return value

array

File

./phantomjs_capture.install, line 20

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 <a href=":url">exec()</a> command is available.', [
      ':url' => $url,
    ]);
  }
  else {
    $message = t('The <a href=":url">exec()</a> command is not available or the user has no permission to use it, you will be unable to use the phantomjs binary.', [
      ':url' => $url,
    ]);
  }
  $requirements['phantomjs_capture'] = [
    'title' => t('PhantomJS Capture'),
    'value' => $message,
    'severity' => $enabled ? REQUIREMENT_OK : REQUIREMENT_ERROR,
  ];
  return $requirements;
}