Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

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

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: 298 lines (11 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