You are here

function _parser_simplepie_sanitize_cache in FeedAPI 6

Same name and namespace in other branches
  1. 5 parser_simplepie/parser_simplepie.module \_parser_simplepie_sanitize_cache()

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

2 calls to _parser_simplepie_sanitize_cache()
parser_simplepie_nodeapi in parser_simplepie/parser_simplepie.module
Delete cache validating functions when feed is deleted
_parser_simplepie_get_parser in parser_simplepie/parser_simplepie.module
Set SimplePie setting

File

parser_simplepie/parser_simplepie.module, line 188
Parse the incoming URL with SimplePie then provide a data structure of the feed

Code

function _parser_simplepie_sanitize_cache() {
  $cache_location = file_directory_path() . '/simplepie_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;
}