]> git.mjollnir.org Git - moodle.git/commitdiff
Now make_upload_directory() is used, avoiding dependencies to
authorstronk7 <stronk7>
Wed, 26 May 2004 16:12:58 +0000 (16:12 +0000)
committerstronk7 <stronk7>
Wed, 26 May 2004 16:12:58 +0000 (16:12 +0000)
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)

admin/cron.php
rss/rsslib.php

index a8d6a0cb372a177c898b57516960072ac730db10..10c5e9fa5035760deb285ef2b99a19b66bd3e220 100644 (file)
 
     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();
index e9d82c542bf002990ed32e09bca77f918f927ff0..b6bb328791145d0301fad9c2f2f194f41f364a4a 100644 (file)
@@ -92,15 +92,10 @@ 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";
@@ -108,6 +103,8 @@ function rss_save_file ($modname,$mod,$result) {
         if ($rss_file) {
             $status = fwrite ($rss_file,$result);
             fclose($rss_file);
+        } else {
+            $status = false;
         }
     }
     return $status;