Skip to content

Commit

Permalink
Now make_upload_directory() is used, avoiding dependencies to
Browse files Browse the repository at this point in the history
backup/lib.php. I think that, gradually, I'll can modify the
backup/restore process to use this "core" function everywhere!!
Bug 1467.
(http://moodle.org/bugs/bug.php?op=show&bugid=1467)
  • Loading branch information
stronk7 committed May 26, 2004
1 parent 555fd3f commit bc706ae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
1 change: 0 additions & 1 deletion admin/cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@

if (!empty($CFG->enablerssfeeds)) { //Defined in admin/variables page
if (file_exists("$CFG->dirroot/rss/rsslib.php")) {
include_once("$CFG->dirroot/backup/lib.php"); // Unfortunately this is required
include_once("$CFG->dirroot/rss/rsslib.php");
echo "Running rssfeeds if required...\n";
flush();
Expand Down
15 changes: 6 additions & 9 deletions rss/rsslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,22 +92,19 @@ function rss_save_file ($modname,$mod,$result) {

$status = true;

$basedir = $CFG->dataroot."/rss";

//Check dataroot/rss exists
$status = check_dir_exists($basedir,true);

$basedir .= "/".$modname;

//Check dataroot/rrs/$modname exists
$status = check_dir_exists($basedir,true);
if (! $basedir = make_upload_directory ("rss/".$modname)) {
//Cannot be created, so error
$status = false;
}

if ($status) {
$file = $basedir .= "/".$mod->id.".xml";
$rss_file = fopen($file,"w");
if ($rss_file) {
$status = fwrite ($rss_file,$result);
fclose($rss_file);
} else {
$status = false;
}
}
return $status;
Expand Down

0 comments on commit bc706ae

Please sign in to comment.