Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250530) (c39b7370636)
moodle_simplepie_file Class Reference

Moodle Customised version of the SimplePie_File class. More...

Inheritance diagram for moodle_simplepie_file:
File Base

Public Member Functions

 __construct ($url, $timeout=10, $redirects=5, $headers=null, $useragent=null, $force_fsockopen=false)
 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.
 
 load ()
 Retrieve the data saved to the cache.
 
 mtime ()
 Retrieve the last modified time for the cache.
 
 save ($data)
 Save data to the cache.
 
 touch ()
 Set the last modified time to the current time.
 
 unlink ()
 Remove the cache.
 

Public Attributes

 $body
 
 $error
 
 $headers = []
 
 $method = SimplePie\SimplePie::FILE_SOURCE_NONE
 
 $permanent_url
 
 $redirects = 0
 
 $status_code = 0
 
 $success = true
 
 $url
 
 $useragent
 
string const TYPE_FEED = 'spc'
 Feed cache type.
 
string const TYPE_IMAGE = 'spi'
 Image cache type.
 

Protected Attributes

string $extension
 File extension.
 
string $filename
 Filename.
 
string $location
 Location string.
 
string $name
 File path.
 

Detailed Description

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.

Member Function Documentation

◆ load()

File::load ( )
inherited

Retrieve the data saved to the cache.

Return values
arrayData for SimplePie::$data

Implements Base.

◆ mtime()

File::mtime ( )
inherited

Retrieve the last modified time for the cache.

Return values
intTimestamp

Implements Base.

◆ save()

File::save ( $data)
inherited

Save data to the cache.

Parameters
array | SimplePie::SimplePie$dataData to store in the cache. If passed a SimplePie object, only cache the $data property
Return values
boolSuccessfulness

Implements Base.

◆ touch()

File::touch ( )
inherited

Set the last modified time to the current time.

Return values
boolSuccess status

Implements Base.

◆ unlink()

File::unlink ( )
inherited

Remove the cache.

Return values
boolSuccess status

Implements Base.

Member Data Documentation

◆ $location

string File::$location
protectedinherited

Location string.

See also
SimplePie::$cache_location

The documentation for this class was generated from the following file: