You are here

function socialfeed_requirements in Social Feed 6

Same name and namespace in other branches
  1. 7 socialfeed.install \socialfeed_requirements()

Implements hook_requirements().

File

./socialfeed.install, line 10
Install, update and uninstall functions for the XXX module.

Code

function socialfeed_requirements($phase) {
  $requirements = array();
  $t = get_t();
  if ($phase == 'runtime') {
    if (in_array('SimpleXML', get_loaded_extensions())) {
      $requirements['socialfeed_simplexml'] = array(
        'title' => t('SimpleXML'),
        'value' => 'SimpleXML is installed.',
        'severity' => REQUIREMENT_OK,
      );
    }
  }
  if ($phase == 'install') {
    if (in_array('SimpleXML', get_loaded_extensions())) {
      $requirements['socialfeed'] = array(
        'title' => t('SimpleXML'),
        'value' => 'All dependencies are installed.',
        'severity' => REQUIREMENT_OK,
      );
    }
    else {
      $requirements['socialfeed'] = array(
        'title' => t('Not installed.'),
        'severity' => REQUIREMENT_ERROR,
        'description' => t('Please install the SimpleXML extension before installing the Social Media Feed.'),
      );
    }
  }
  return $requirements;
}