You are here

function vkxp_requirements in VK CrossPoster 6

Same name and namespace in other branches
  1. 6.3 vkxp.install \vkxp_requirements()
  2. 6.2 vkxp.install \vkxp_requirements()
  3. 7.2 vkxp.install \vkxp_requirements()
  4. 7 vkxp.install \vkxp_requirements()

Implementation of hook_requirements()

File

./vkxp.install, line 11
Requirements and uninstall functions for the vkxp module.

Code

function vkxp_requirements($phase) {
  $requirements = array();

  // Ensure translations don't break at install time.
  $t = get_t();
  if ($phase == 'runtime') {

    // Check for presence of curl support.
    if (!function_exists('curl_init')) {
      $requirements['vkxp_curl'] = array(
        'title' => $t('cURL Support for VKontakte CrossPoster'),
        'value' => $t('VKontakte CrossPoster requires <a href="http://php.net/manual/en/book.curl.php">cURL support in PHP</a> to function fully.  Without this, contents will not be posted to vkontakte.'),
        'severity' => REQUIREMENT_ERROR,
      );
    }
    else {
      $requirements['vkxp_curl'] = array(
        'title' => $t('cURL Support for VKontakte CrossPoster'),
        'value' => $t('cURL enabled'),
        'severity' => REQUIREMENT_OK,
      );
    }
  }
  return $requirements;
}