You are here

function boost_get_http_status in Boost 6

Determines the HTTP response code that the current page request will be returning by examining the HTTP headers that have been output so far.

2 calls to boost_get_http_status()
boost_exit in ./boost.module
Implementation of hook_exit(). Performs cleanup tasks.
_boost_ob_handler in ./boost.module
PHP output buffering callback for static page caching.

File

./boost.module, line 2647
Provides static file caching for Drupal text output. Pages, Feeds, ect...

Code

function boost_get_http_status() {
  if (function_exists('drupal_get_headers')) {
    foreach (explode("\n", drupal_get_headers()) as $header) {
      preg_match('!^HTTP\\/.*?\\s+(\\d+)!', $header, $matches);
      if (isset($matches[1])) {
        return (int) $matches[1];
      }
    }
  }
  return 200;
}