You are here

function radioactivity_requirements in Radioactivity 6

Same name and namespace in other branches
  1. 7.2 radioactivity.module \radioactivity_requirements()

File

./radioactivity.module, line 183

Code

function radioactivity_requirements($phase) {
  $requirements = array();
  $t = get_t();
  switch ($phase) {
    case 'runtime':
      $mc_status = radioactivity_determine_memcached_availability();
      $requirements['radioactivity_memcache'] = array(
        'title' => $t('Radioactivity memcache acceleration'),
        'value' => _radioactivity_get_memcached_availability_string($mc_status),
        'severity' => $mc_status > 0 ? REQUIREMENT_OK : REQUIREMENT_INFO,
      );
      if ($mc_status > 0) {

        // additional checks, as memcache is available
        $bins = variable_get('memcache_bins', array());
        $custom_bin = isset($bins['radioactivity']);
        $requirements['radioactivity_memcache_bin'] = array(
          'title' => $t('Radioactivity memcache bin %r', array(
            '%r' => 'radioactivity',
          )),
          'value' => $custom_bin ? $t('Configured') : $t('Not configured, using default bin'),
          'severity' => $custom_bin ? REQUIREMENT_OK : REQUIREMENT_INFO,
        );
      }
      break;
  }
  return $requirements;
}