Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
curl_cache Class Reference

This class is used by cURL class, use case: More...

Public Member Functions

stdClass __construct ($module='repository')
 Constructor.
 
 cleanup ($expire)
 Remove cache files.
 
stdClass get ($param)
 Get cached value.
 
object refresh ()
 delete current user's cache file
 
object set ($param, $val)
 Set cache value.
 

Public Attributes

string $dir = ''
 Path to cache directory.
 

Detailed Description

This class is used by cURL class, use case:

$CFG->repositorycacheexpire = 120; $CFG->curlcache = 120;

$c = new curl(array('cache'=>true), 'module_cache'=>'repository'); $ret = $c->get('http://www.google.com');

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

stdClass curl_cache::__construct ( $module = 'repository')

Constructor.

$CFG

Parameters
string$modulewhich module is using curl_cache

Member Function Documentation

◆ cleanup()

curl_cache::cleanup ( $expire)

Remove cache files.

Parameters
int$expireThe number of seconds before expiry

◆ get()

stdClass curl_cache::get ( $param)

Get cached value.

$CFG @global stdClass $USER

Parameters
mixed$param
Return values
bool|string

◆ refresh()

object curl_cache::refresh ( )

delete current user's cache file

$CFG @global object $USER

◆ set()

object curl_cache::set ( $param,
$val )

Set cache value.

$CFG @global object $USER

Parameters
mixed$param
mixed$val

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