Skip to content

Commit

Permalink
rss MDL-23383 moved the RSS cache to /dataroot/cache/rss
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Davis committed Jul 19, 2010
1 parent 2b9d57c commit d5f25d9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions blog/rsslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
}

Expand Down
8 changes: 4 additions & 4 deletions lib/rsslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}
}
Expand Down Expand Up @@ -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;
}
Expand All @@ -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) {
Expand Down
1 change: 0 additions & 1 deletion mod/forum/rsslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down

0 comments on commit d5f25d9

Please sign in to comment.