You are here

function parser_common_syndication_nodeapi in FeedAPI 5

Same name and namespace in other branches
  1. 6 parser_common_syndication/parser_common_syndication.inc \parser_common_syndication_nodeapi()

Delete cache validating functions when feed is deleted

File

parser_common_syndication/parser_common_syndication.module, line 197
Parse the incoming URL with SimpleXML then provide a data structure of the feed. Requires PHP5 because of SimpleXML.

Code

function parser_common_syndication_nodeapi(&$node, $op) {
  if (isset($node->feed) || feedapi_enabled_type($node->type)) {
    switch ($op) {
      case 'delete':
        db_query("DELETE FROM {parser_common_syndication} WHERE url = '%s'", $node->feed->url);
        $cache_dir = _parser_common_syndication_sanitize_cache();
        $cache_filename = $cache_dir . '/' . md5($node->feed->url);
        if (file_exists($cache_filename)) {
          unlink($cache_filename);
        }
        break;
    }
  }
}