mirror of
https://github.com/moodle/moodle.git
synced 2025-05-13 19:56:25 +02:00
rss MDL-23383 moved the RSS cache to /dataroot/cache/rss
This commit is contained in:
parent
2b9d57c484
commit
d5f25d957e
@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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.
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user