You are here

function session_cache_file_requirements in Session Cache API 7

Same name and namespace in other branches
  1. 8 session_cache_file/session_cache_file.module \session_cache_file_requirements()

Implements hook_requirements().

File

session_cache_file/session_cache_file.install, line 11
session_cache_file.install

Code

function session_cache_file_requirements($phase) {
  if ($phase != 'runtime') {
    return;
  }
  $t = get_t();
  $requirements['session_cache_file']['title'] = $t('Session Cache File cache');
  $session_cache_root = session_cache_file_directory();
  if ($session_cache_root) {
    $requirements['session_cache_file']['value'] = $t('Installed at %path', array(
      '%path' => $session_cache_root,
    ));
    $requirements['session_cache_file']['severity'] = REQUIREMENT_OK;
  }
  else {
    $requirements['session_cache_file']['value'] = $t('Not set or could not be created. Check directory permissions or re-configure <a href="@url">here</a>.', array(
      '@url' => url('admin/config/media/file-system'),
    ));
    $requirements['session_cache_file']['severity'] = REQUIREMENT_ERROR;
  }
  return $requirements;
}