You are here

function linkchecker_requirements in Link checker 5.2

Same name and namespace in other branches
  1. 6.2 linkchecker.install \linkchecker_requirements()

Implementation of hook_requirements().

File

./linkchecker.install, line 118
Installation file for Link Checker module.

Code

function linkchecker_requirements($phase) {
  $requirements = array();
  $t = get_t();
  switch ($phase) {
    case 'install':

      /*      // Module cannot work without external HTTP requests.
            if (variable_get('drupal_http_request_fails', TRUE) && !linkchecker_check_http_request()) {
              $requirements['http requests'] = array(
                'title' => $t('HTTP request status'),
                'value' => $t('Fails'),
                'severity' => REQUIREMENT_ERROR,
                'description' => $t('Your system or network configuration does not allow Drupal to access web pages, resulting in reduced functionality. This could be due to your webserver configuration or PHP settings, and should be resolved in order to download information about available updates, fetch aggregator feeds, sign in via OpenID, or use other network-dependent services.'),
              );
            } */

      // MySQL version with subselect support is required.
      $version = db_version();
      if (in_array($GLOBALS['db_type'], array(
        'mysql',
        'mysqli',
      )) && version_compare($version, LINKCHECKER_MINIMUM_MYSQL) < 0) {
        $requirements['linkchecker_minimum_mysql'] = array(
          'title' => $t('MySQL database'),
          'value' => $version,
          'severity' => REQUIREMENT_ERROR,
          'description' => $t('Your MySQL Server is too old. Link Checker requires at least MySQL %version.', array(
            '%version' => LINKCHECKER_MINIMUM_MYSQL,
          )),
        );
      }
      break;
  }
  return $requirements;
}