Skip to content

Commit

Permalink
enable simplerss cache, add config option
Browse files Browse the repository at this point in the history
  • Loading branch information
slankes committed Nov 7, 2008
1 parent 3e02b09 commit 508c16e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion config_defaults_inc.php
Expand Up @@ -13,6 +13,9 @@

$g_lang_cvs_path = 'lang-cvs/';

# Directory for simplepie cache - set to false to disable cache
$g_rss_cache_path = '/tmp/';

########################################
# Include user's config, if available
########################################
Expand All @@ -21,4 +24,4 @@
if ( file_exists( $t_config_inc ) ) {
require_once( $t_config_inc );
}
?>
?>
5 changes: 4 additions & 1 deletion index.php
Expand Up @@ -52,7 +52,10 @@ function update_visits() {
// Parse it
$feed = new SimplePie();
$feed->set_feed_url( 'http://www.mantisbt.org/blog/?feed=rss2' );
$feed->enable_cache(false);
if (empty($g_rss_cache_path))
$feed->enable_cache(false);
else
$feed->set_cache_location($g_rss_cache_path);
$feed->init();

$items = $feed->get_items();
Expand Down

0 comments on commit 508c16e

Please sign in to comment.