You are here

function cacheexclude_exit in CacheExclude 5

Implementation of hook_exit().

File

./cacheexclude.module, line 32

Code

function cacheexclude_exit($destination = NULL) {
  global $base_root;
  if ($destination == NULL) {
    $pages = trim(variable_get('cacheexclude_list', ''));
    if (strlen($pages) == 0) {
      return;
    }
    else {
      $pages = explode("\n", variable_get('cacheexclude_list', ''));
      $this_page = request_uri();
      foreach ($pages as $page) {
        $page = trim($page);
        if ($page && strstr($this_page, $page) !== false) {
          cache_clear_all($base_root . $this_page, 'cache_page');
          return;
        }
      }
    }
  }
}