Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 311] [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403] [Versions 39 and 310]

This plugin is used to access files by providing an url

Copyright: 2010 Dongsheng Cai {@link http://dongsheng.org}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 289 lines (10 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 1 file
 repository/url/locallib.php

Defines 1 class


Class: repository_url  - X-Ref

repository_url class
A subclass of repository, which is used to download a file from a specific url

__construct($repositoryid, $context = SYSCONTEXTID, $options = array()   X-Ref

param: int $repositoryid
param: object $context
param: array $options

check_login()   X-Ref
No description

print_login()   X-Ref

return: mixed

get_listing($path='', $page='')   X-Ref

param: mixed $path
param: string $search
return: array

parse_file($baseurl, $relativeurl, &$list, $mainfile = false)   X-Ref
Parses one file (either html or css)

param: string $baseurl (optional) URL of the file where link to this file was found
param: string $relativeurl relative or absolute link to the file
param: array $list
param: bool $mainfile true only for main HTML false and false for all embedded/linked files

add_image_to_list($baseurl, $url, &$list)   X-Ref
No description

guess_filename($url, $type)   X-Ref
No description

escape_url($url)   X-Ref
Escapes a url by replacing spaces with %20.

Note: In general moodle does not automatically escape urls, but for the purposes of making this plugin more user friendly
and make it consistent with some other areas in moodle (such as mod_url), urls will automatically be escaped.

If moodle_url or PARAM_URL is changed to clean characters that need to be escaped, then this function can be removed

param: string $url An unescaped url.
return: string The escaped url

supported_returntypes()   X-Ref
No description

get_file_source_info($url)   X-Ref
Return the source information

param: stdClass $url
return: string|null

supported_filetypes()   X-Ref
file types supported by url downloader plugin

return: array

contains_private_data()   X-Ref
Is this repository accessing private data?

return: bool