mirror of
https://github.com/moodle/moodle.git
synced 2025-05-02 06:22:59 +02:00
MDL-13766
remove require_once call to curl.class.php
This commit is contained in:
parent
bb2c046d5c
commit
84df43de21
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user