mirror of
https://github.com/moodle/moodle.git
synced 2025-08-02 23:59:41 +02:00
Merge branch 'MDL-36538_webdav_memory' of git://github.com/davosmith/moodle
This commit is contained in:
commit
8df07e5086
2 changed files with 63 additions and 45 deletions
|
@ -71,17 +71,13 @@ class repository_webdav extends repository {
|
|||
return true;
|
||||
}
|
||||
public function get_file($url, $title = '') {
|
||||
global $CFG;
|
||||
$url = urldecode($url);
|
||||
$path = $this->prepare_file($title);
|
||||
$buffer = '';
|
||||
if (!$this->dav->open()) {
|
||||
return false;
|
||||
}
|
||||
$webdavpath = rtrim('/'.ltrim($this->options['webdav_path'], '/ '), '/ '); // without slash in the end
|
||||
$this->dav->get($webdavpath. $url, $buffer);
|
||||
$fp = fopen($path, 'wb');
|
||||
fwrite($fp, $buffer);
|
||||
$this->dav->get_file($webdavpath. $url, $path);
|
||||
return array('path'=>$path);
|
||||
}
|
||||
public function global_search() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue