Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
Cache Class Reference

Used to create cache objects. More...

Public Member Functions

 create ($location, $filename, $extension)
 Create a new SimplePie\Cache object.
 

Static Public Member Functions

static get_handler ($location, $filename, $extension)
 Create a new SimplePie\Cache object.
 
static parse_URL ($url)
 Parse a URL into an array.
 
static register ($type, $class)
 Register a handler.
 

Static Protected Attributes

static array $handlers
 Cache handler classes.
 

Detailed Description

Used to create cache objects.

This class can be overloaded with {

See also
SimplePie\set_cache_class()}, although the preferred way is to create your own handler via {
register()}

@subpackage Caching

Deprecated
since SimplePie 1.8.0, use "SimplePie::SimplePie::set_cache()" instead

Member Function Documentation

◆ create()

Cache::create ( $location,
$filename,
$extension )

Create a new SimplePie\Cache object.

Deprecated
since SimplePie 1.3.1, use {
See also
get_handler()} instead

◆ get_handler()

static Cache::get_handler ( $location,
$filename,
$extension )
static

Create a new SimplePie\Cache object.

Parameters
string$locationURL location (scheme is used to determine handler)
string$filenameUnique identifier for cache object
Base\TYPE_FEED | Base\TYPE_IMAGE$extension'spi' or 'spc'
Return values
BaseType of object depends on scheme of $location

◆ parse_URL()

static Cache::parse_URL ( $url)
static

Parse a URL into an array.

Parameters
string$url
Return values
array

◆ register()

static Cache::register ( $type,
$class )
static

Register a handler.

Parameters
string$typeDSN type to register for
class-string<Base>$class Name of handler class. Must implement Base

Member Data Documentation

◆ $handlers

array Cache::$handlers
staticprotected
Initial value:
= [
'mysql' => 'SimplePie\Cache\MySQL',
'memcache' => 'SimplePie\Cache\Memcache',
'memcached' => 'SimplePie\Cache\Memcached',
'redis' => 'SimplePie\Cache\Redis'
]

Cache handler classes.

These receive 3 parameters to their constructor, as documented in {

See also
register()}

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