function boost_deliver_html_page

cis7 boost.module boost_deliver_html_page($page_callback_result)
cle7 boost.module boost_deliver_html_page($page_callback_result)
elmsmedia7 boost.module boost_deliver_html_page($page_callback_result)
icor7 boost.module boost_deliver_html_page($page_callback_result)
meedjum_blog7 boost.module boost_deliver_html_page($page_callback_result)
mooc7 boost.module boost_deliver_html_page($page_callback_result)

Capture error conditions.

Parameters

$page_callback_result: The result of a page callback. Can be one of:

  • NULL: to indicate no content.
  • An integer menu status constant: to indicate an error condition.
  • A string of HTML content.
  • A renderable array of content.

See also

drupal_deliver_html_page()

1 string reference to 'boost_deliver_html_page'

File

sites/all/modules/ulmus/boost/boost.module, line 1368
Caches generated output as a static file to be served directly from the webserver.

Code

function boost_deliver_html_page($page_callback_result) {
  global $_boost;

  // Menu status constants are integers; page content is a string or array.
  if (is_int($page_callback_result)) {
    // @todo: Break these up into separate functions?
    switch ($page_callback_result) {
      case MENU_NOT_FOUND:
        // 404 page.
        $_boost['menu_item']['status'] = 404;
        break;

      case MENU_ACCESS_DENIED:
        // 403 page.
        $_boost['menu_item']['status'] = 403;
        break;

      case MENU_SITE_OFFLINE:
        // 503 page.
        $_boost['menu_item']['status'] = 503;
        break;
    }
  }

  // Call original function
  drupal_deliver_html_page($page_callback_result);

  // Last possible place to send a watchdog message without a shutdown function.
  if (variable_get('boost_message_debug', BOOST_MESSAGE_DEBUG) && $_boost['args'][0] != 'admin') {
    watchdog('boost', boost_print_r($_boost), array(), WATCHDOG_DEBUG);
  }
}