|
Moodle PHP Documentation 4.5
Moodle 4.5.5+ (Build: 20250711) (ce34e8ff087)
|
Caches data to redis. More...
Public Member Functions | |
| __construct ($location, $name, $options=null) | |
| Create a new cache object. | |
| load () | |
| Retrieve the data saved to the cache. | |
| mtime () | |
| Retrieve the last modified time for the cache. | |
| save ($data) | |
| Save data to the cache. | |
| setRedisClient (NativeRedis $cache) | |
| touch () | |
| Set the last modified time to the current time. | |
| unlink () | |
| Remove the cache. | |
Public Attributes | |
| string const | TYPE_FEED = 'spc' |
| Feed cache type. | |
| string const | TYPE_IMAGE = 'spi' |
| Image cache type. | |
Protected Attributes | |
| NativeRedis | $cache |
| Redis instance. | |
| string | $name |
| Cache name. | |
| array | $options |
| Options. | |
Caches data to redis.
Registered for URLs with the "redis" protocol
For example, redis://localhost:6379/?timeout=3600&prefix=sp_&dbIndex=0 will connect to redis on localhost on port 6379. All tables will be prefixed with simple_primary- and data will expire after 3600 seconds
@subpackage Caching @uses Redis
| Redis::__construct | ( | $location, | |
| $name, | |||
| $options = null ) |
| Redis::load | ( | ) |
| Redis::mtime | ( | ) |
| Redis::save | ( | $data | ) |
| Redis::setRedisClient | ( | NativeRedis | $cache | ) |
| NativeRedis | $cache |
| Redis::touch | ( | ) |
| Redis::unlink | ( | ) |