You are here

function linkchecker_requirements in Link checker 6.2

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

Implementation of hook_requirements().

File

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

Code

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

      // 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;
}