From d5f25d957e953b9117e9a9b1b52a88a368d1cf7c Mon Sep 17 00:00:00 2001 From: Andrew Davis Date: Mon, 19 Jul 2010 06:46:23 +0000 Subject: [PATCH] rss MDL-23383 moved the RSS cache to /dataroot/cache/rss --- blog/rsslib.php | 4 ++-- lib/rsslib.php | 8 ++++---- mod/forum/rsslib.php | 1 - 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/blog/rsslib.php b/blog/rsslib.php index 99630537cb1..6972c17a757 100755 --- a/blog/rsslib.php +++ b/blog/rsslib.php @@ -136,9 +136,9 @@ function blog_rss_file_name($type, $id, $tagid=0) { global $CFG; if ($tagid) { - return "$CFG->dataroot/rss/blog/$type/$id/$tagid.xml"; + return "$CFG->dataroot/cache/rss/blog/$type/$id/$tagid.xml"; } else { - return "$CFG->dataroot/rss/blog/$type/$id.xml"; + return "$CFG->dataroot/cache/rss/blog/$type/$id.xml"; } } diff --git a/lib/rsslib.php b/lib/rsslib.php index 5933dff8bf9..a3b1b19b108 100644 --- a/lib/rsslib.php +++ b/lib/rsslib.php @@ -81,13 +81,13 @@ function rss_print_link($contextid, $userid, $modulename, $id, $tooltiptext='') function rss_delete_file($modname, $instance) { global $CFG; - $dirpath = "$CFG->dataroot/rss/$modname"; + $dirpath = "$CFG->dataroot/cache/rss/$modname"; if (is_dir($dirpath)) { $dh = opendir($dirpath); while (false !== ($filename = readdir($dh))) { if ($filename!='.' && $filename!='..') { if (preg_match("/{$instance->id}_/", $filename)) { - unlink("$CFG->dataroot/rss/$modname/$filename"); + unlink("$CFG->dataroot/cache/rss/$modname/$filename"); } } } @@ -134,7 +134,7 @@ function rss_save_file($modname, $filename, $result) { $status = true; - if (! $basedir = make_upload_directory ('rss/'. $modname)) { + if (! $basedir = make_upload_directory ('cache/rss/'. $modname)) { //Cannot be created, so error $status = false; } @@ -155,7 +155,7 @@ function rss_save_file($modname, $filename, $result) { function rss_get_file_full_name($modname, $filename) { global $CFG; - return "$CFG->dataroot/rss/$modname/$filename.xml"; + return "$CFG->dataroot/cache/rss/$modname/$filename.xml"; } function rss_get_file_name($instance, $sql) { diff --git a/mod/forum/rsslib.php b/mod/forum/rsslib.php index 8dd48078a6f..5e8a2c377bb 100644 --- a/mod/forum/rsslib.php +++ b/mod/forum/rsslib.php @@ -29,7 +29,6 @@ * @global object $DB * @param object $context the context * @param int $forumid the ID of the forum - * @param string $cachepath the path to the cache directory. For example '/home/user/moodledata/rss/forum/' * @param array $args the arguments received in the url * @return string the full path to the cached RSS feed directory. Null if there is a problem. */