You are here

function boost_comment in Boost 6

Same name and namespace in other branches
  1. 5 boost.module \boost_comment()

Implementation of hook_comment(). Acts on comment modification.

File

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

Code

function boost_comment($comment, $op) {
  if (!variable_get('boost_enabled', CACHE_NORMAL)) {
    return;
  }
  if (is_array($comment)) {
    $comment = (object) $comment;
  }

  // Expire the relevant node page from the static page cache to prevent serving stale content:
  switch ($op) {
    case 'insert':
    case 'update':
    case 'publish':
    case 'unpublish':
    case 'delete':
      if (!empty($comment->nid)) {
        $node = node_load($comment->nid);
        boost_expire_node($node, $comment->nid);
      }
      break;
  }
}