You are here

function _parser_common_syndication_sanitize_cache in FeedAPI 6

Same name and namespace in other branches
  1. 5 parser_common_syndication/parser_common_syndication.module \_parser_common_syndication_sanitize_cache()

Set the default caching directory if the current setting is not useable

3 calls to _parser_common_syndication_sanitize_cache()
parser_common_syndication_nodeapi in parser_common_syndication/parser_common_syndication.inc
Delete cache validating functions when feed is deleted
_parser_common_syndication_cache_get in parser_common_syndication/parser_common_syndication.inc
Get the cached version of the <var>$url</var>
_parser_common_syndication_cache_set in parser_common_syndication/parser_common_syndication.inc
Store the parsed feed into the cache

File

parser_common_syndication/parser_common_syndication.inc, line 662
Downloading and parsing functions for Common Syndication Parser

Code

function _parser_common_syndication_sanitize_cache() {
  $cache_location = file_directory_path() . '/parser_common_syndication_cache';
  if (!is_writeable($cache_location) || !is_dir($cache_location)) {
    $cache_location = file_create_path($cache_location);
    if (!file_exists($cache_location) && is_writable(file_directory_path())) {
      mkdir($cache_location);
    }
    if (!is_writeable($cache_location)) {
      return FALSE;
    }
  }
  return $cache_location;
}