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 402] [Versions 310 and 403]

Moodle - Modular Object-Oriented Dynamic Learning Environment http://moodle.org Copyright (C) 1999 onwards Martin Dougiamas  http://dougiamas.com This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.

Author: Dan Poltawski <talktodan@gmail.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 223 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 3 classes

moodle_simplepie:: (3 methods):
  __construct()
  get_cache_directory()
  reset_cache()

moodle_simplepie_file:: (1 method):
  __construct()

moodle_simplepie_sanitize:: (1 method):
  sanitize()


Class: moodle_simplepie  - X-Ref

Moodle Customised version of the SimplePie class

This class extends the stock SimplePie class
in order to make sensible configuration choices,
such as using the Moodle cache directory and
curl functions/proxy config for making http
requests in line with moodle configuration.

__construct($feedurl = null, $timeout = 2)   X-Ref
Constructor - creates an instance of the SimplePie class
with Moodle defaults.

param: string $feedurl optional URL of the feed
param: int $timeout how many seconds requests should wait for server response

get_cache_directory()   X-Ref
Get path for feed cache directory

return: string absolute path to cache directory

reset_cache()   X-Ref
Reset RSS cache

return: boolean success if cache clear or didn't exist

Class: moodle_simplepie_file  - X-Ref

Moodle Customised version of the SimplePie_File class

This class extends the stock SimplePie class
in order to utilise Moodles own curl class for making
http requests. By using the moodle curl class
we ensure that the correct proxy configuration is used.
__construct($url, $timeout = 10, $redirects = 5, $headers = null, $useragent = null, $force_fsockopen = false)   X-Ref
The constructor is a copy of the stock simplepie File class which has
been modified to add in use the Moodle curl class rather than php curl
functions.


Class: moodle_simplepie_sanitize  - X-Ref

Customised feed sanitization using HTMLPurifier.

sanitize($data, $type, $base = '')   X-Ref
No description