You are here

function homebox_requirements in Homebox 6.3

Same name and namespace in other branches
  1. 6.2 homebox.module \homebox_requirements()

Implementation of hook_requirements()

File

./homebox.module, line 1517
Homebox main file, takes care of global functions settings constants, etc.

Code

function homebox_requirements($phase) {
  $requirements = array();
  switch ($phase) {
    case 'runtime':
      if (variable_get('homebox_version', 0) != HOMEBOX_VERSION) {
        $requirements['homebox_upgrade'] = array(
          'title' => t('Homebox 2'),
          'value' => t('Corrupt'),
          'description' => t('There is no upgrade path between Homebox 1.x and 2.x. You must completely uninstall and reinstall Homebox.'),
          'severity' => REQUIREMENT_ERROR,
        );
      }
      if (jquery_ui_get_version() != HOMEBOX_JQUERY_UI_VERSION) {
        $requirements['homebox_jquery'] = array(
          'title' => t('Homebox 2'),
          'value' => jquery_ui_get_version(),
          'description' => t('Homebox 2 is designed to run with jQuery UI 1.6.'),
          'severity' => REQUIREMENT_WARNING,
        );
      }
    case 'install':
      $requirements['homebox_php'] = array(
        'title' => t('Homebox 2'),
        'value' => phpversion(),
        'description' => t('Homebox 2 requires a PHP version 5.2 or greater.'),
        'severity' => _homebox_check_php() ? REQUIREMENT_OK : REQUIREMENT_ERROR,
      );
  }
  return $requirements;
}