Skip navigation
Help

hook_exit

6 core.php hook_exit($destination = NULL)
7 system.api.php hook_exit($destination = NULL)

Perform cleanup tasks.

This hook is run at the end of each page request. It is often used for page logging and specialized cleanup. This hook MUST NOT print anything.

Only use this hook if your code must run even for cached page views. If you have code which must run once on all non cached pages, use hook_init instead. Thats the usual case. If you implement this hook and see an error like 'Call to undefined function', it is likely that you are depending on the presence of a module which has not been loaded yet. It is not loaded because Drupal is still in bootstrap mode.

Parameters

$destination: If this hook is invoked as part of a drupal_goto() call, then this argument will be a fully-qualified URL that is the destination of the redirect.

Related topics

2 string references to 'hook_exit'

7 functions implement hook_exit()

3 invocations of hook_exit()

File

drupal/modules/system/system.api.php, line 685
Hooks provided by Drupal core and the System module.

Code

function hook_exit($destination = NULL) {
  db_update('counter')
    ->expression('hits', 'hits + 1')
    ->condition('type', 1)
    ->execute();
}