You are here

health_check.module in Health check 7

Contains Health check module.

File

health_check.module
View source
<?php

/**
 * @file
 * Contains Health check module.
 */

/**
 * Implements hook_menu().
 */
function health_check_menu() {
  $items['health'] = array(
    'page callback' => 'health_check_content',
    'access callback' => TRUE,
  );
  return $items;
}

/**
 * Implements hook_menu_site_status_alter().
 */
function health_check_menu_site_status_alter(&$menu_site_status, $path) {

  // Allow access to health check even if site is in offline mode.
  if ($menu_site_status == MENU_SITE_OFFLINE && $path == 'health') {
    $menu_site_status = MENU_SITE_ONLINE;
  }
}

/**
 * Page callback for /health.
 *
 * @return string
 *   The current time.
 */
function health_check_content() {
  drupal_page_is_cacheable(FALSE);
  echo (string) time();
  drupal_exit();
}

Functions