Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Public Attributes | List of all members
curl_cache Class Reference

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

Public Member Functions

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

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: