You are here

function session_api_cron in Session API 5

Same name and namespace in other branches
  1. 6 session_api.module \session_api_cron()
  2. 7 session_api.module \session_api_cron()

Implementation of hook_cron().

File

./session_api.module, line 67
The Session API module provides a quick interface for storing information in the session.

Code

function session_api_cron() {

  // should any cleanup be run
  if (!variable_get('session_api_run_cron_session_api', FALSE)) {
    return;
  }

  // find modules that have this hook
  $modules = module_implements('session_api_cleanup');

  // run Session API hook first
  array_unshift($modules, 'session_api');
  $modules = array_unique($modules);
  foreach ($modules as $module) {
    if (variable_get('session_api_run_cron_' . $module, FALSE)) {
      module_invoke($module, 'session_api_cleanup');
    }
  }
}