]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-13766
authordongsheng <dongsheng>
Fri, 18 Jul 2008 07:44:14 +0000 (07:44 +0000)
committerdongsheng <dongsheng>
Fri, 18 Jul 2008 07:44:14 +0000 (07:44 +0000)
remove require_once call to curl.class.php

repository/lib.php

index 2e3129ac96a1f8d83f7cb6672d9145ca8541c720..90f36cb7383f7a6151d051f97070b23f7f361682 100644 (file)
@@ -113,23 +113,18 @@ abstract class repository {
         if(is_dir($CFG->dataroot.'/repository/download')) {
             $dir = $CFG->dataroot.'/repository/download/';
         }
-        if(file_exists($CFG->dirroot.'/repository/curl.class.php')) {
-            if(empty($file)) {
-                $file = uniqid('repo').'_'.time().'.tmp';
-            }
-            if(file_exists($dir.$file)){
-                $file = uniqid('m').$file;
-            }
-            $fp = fopen($dir.$file, 'w');
-            require_once($CFG->dirroot.'/repository/curl.class.php');
-            $c = new curl;
-            $c->download(array(
-                array('url'=>$url, 'file'=>$fp)
-            ));
-            return $dir.$file;
-        } else {
-            return null;
+        if(empty($file)) {
+            $file = uniqid('repo').'_'.time().'.tmp';
+        }
+        if(file_exists($dir.$file)){
+            $file = uniqid('m').$file;
         }
+        $fp = fopen($dir.$file, 'w');
+        $c = new curl;
+        $c->download(array(
+            array('url'=>$url, 'file'=>$fp)
+        ));
+        return $dir.$file;
     }
 
     /**