The cache dummy store.
More...
|
string | $name |
| The name of this store.
|
|
bool | $persist = false |
| Gets set to true if this store is going to store data. More...
|
|
array | $store = array() |
| The stored data array.
|
|
The cache dummy store.
- Copyright
- 2012 Sam Hemelryk
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
cachestore_dummy::__construct |
( |
|
$name = 'Dummy store' , |
|
|
array |
$configuration = array() |
|
) |
| |
Constructs a dummy store instance.
- Parameters
-
string | $name | |
array | $configuration | |
Reimplemented from cache_store.
◆ are_requirements_met()
static cachestore_dummy::are_requirements_met |
( |
| ) |
|
|
static |
◆ can_add_instance()
static cachestore_dummy::can_add_instance |
( |
| ) |
|
|
static |
Returns true if the user can add an instance.
- Return values
-
Reimplemented from cache_store.
◆ cleanup()
cachestore_dummy::cleanup |
( |
| ) |
|
◆ create_clone()
cache_store::create_clone |
( |
array |
$details = array() | ) |
|
|
inherited |
Creates a clone of this store instance ready to be initialised.
This method is used so that a cache store needs only be constructed once. Future requests for an instance of the store will be given a cloned instance.
If you are writing a cache store that isn't compatible with the clone operation you can override this method to handle any situations you want before cloning.
- Parameters
-
array | $details | An array containing the details of the store from the cache config. |
- Return values
-
◆ delete()
cachestore_dummy::delete |
( |
|
$key | ) |
|
Deletes an item from the cache.
- Parameters
-
- Return values
-
Reimplemented from cache_store.
◆ delete_many()
cachestore_dummy::delete_many |
( |
array |
$keys | ) |
|
Deletes many items from the cache.
- Parameters
-
- Return values
-
Reimplemented from cache_store.
◆ get()
cachestore_dummy::get |
( |
|
$key | ) |
|
Returns the data for the given key.
- Parameters
-
- Return values
-
Reimplemented from cache_store.
◆ get_many()
cachestore_dummy::get_many |
( |
|
$keys | ) |
|
Gets' the values for many keys.
- Parameters
-
- Return values
-
Reimplemented from cache_store.
◆ get_supported_features()
static cachestore_dummy::get_supported_features |
( |
array |
$configuration = array() | ) |
|
|
static |
◆ get_supported_modes()
static cachestore_dummy::get_supported_modes |
( |
array |
$configuration = array() | ) |
|
|
static |
◆ get_warnings()
cache_store::get_warnings |
( |
| ) |
|
|
inherited |
Can be overridden to return any warnings this store instance should make to the admin.
This should be used to notify things like configuration conflicts etc. The warnings returned here will be displayed on the cache configuration screen.
- Return values
-
string[] | An array of warning strings from the store instance. |
Reimplemented in cachestore_memcached.
◆ initialise()
Initialises the store instance for a definition.
- Parameters
-
Reimplemented from cache_store.
◆ initialise_test_instance()
static cachestore_dummy::initialise_test_instance |
( |
cache_definition |
$definition | ) |
|
|
static |
Generates an instance of the cache store that can be used for testing.
- Parameters
-
- Return values
-
Implements cache_store_interface.
◆ instance_created()
cache_store::instance_created |
( |
| ) |
|
|
inherited |
Performs any necessary operation when the store instance has been created.
- Since
- Moodle 2.5
Reimplemented in cachestore_file.
◆ instance_deleted()
cachestore_dummy::instance_deleted |
( |
| ) |
|
Performs any necessary operation when the store instance is being deleted.
This method may be called before the store has been initialised.
- Since
- Moodle 3.2
Reimplemented from cache_store.
◆ is_initialised()
cachestore_dummy::is_initialised |
( |
| ) |
|
Returns true if this has been initialised.
- Return values
-
Reimplemented from cache_store.
◆ is_ready()
cache_store::is_ready |
( |
| ) |
|
|
inherited |
◆ is_searchable()
cache_store::is_searchable |
( |
| ) |
|
|
inherited |
Returns true if the store instance is searchable.
- Return values
-
◆ is_supported_mode()
static cachestore_dummy::is_supported_mode |
( |
|
$mode | ) |
|
|
static |
◆ my_name()
cachestore_dummy::my_name |
( |
| ) |
|
Returns the name of this instance.
- Return values
-
Reimplemented from cache_store.
◆ purge()
cachestore_dummy::purge |
( |
| ) |
|
Deletes all of the items from the cache.
- Return values
-
Reimplemented from cache_store.
◆ ready_to_be_used_for_testing()
static cache_store::ready_to_be_used_for_testing |
( |
| ) |
|
|
staticinherited |
Returns true if this cache store instance is both suitable for testing, and ready for testing.
Cache stores that support being used as the default store for unit and acceptance testing should override this function and return true if there requirements have been met.
- Return values
-
Reimplemented in cachestore_redis, cachestore_mongodb, cachestore_memcached, and cachestore_apcu.
◆ set()
cachestore_dummy::set |
( |
|
$key, |
|
|
|
$data |
|
) |
| |
Sets an item in the cache.
- Parameters
-
- Return values
-
Reimplemented from cache_store.
◆ set_many()
cachestore_dummy::set_many |
( |
array |
$keyvaluearray | ) |
|
Sets many items in the cache.
- Parameters
-
- Return values
-
Reimplemented from cache_store.
◆ supports_data_guarantee()
cache_store::supports_data_guarantee |
( |
| ) |
|
|
inherited |
Returns true if the store instance guarantees data.
- Return values
-
◆ supports_dereferencing_objects()
cache_store::supports_dereferencing_objects |
( |
| ) |
|
|
inherited |
Returns true if the store automatically dereferences objects.
- Return values
-
◆ supports_multiple_identifiers()
cache_store::supports_multiple_identifiers |
( |
| ) |
|
|
inherited |
◆ supports_native_ttl()
cache_store::supports_native_ttl |
( |
| ) |
|
|
inherited |
Returns true if the store instance supports native ttl.
- Return values
-
◆ unit_test_configuration()
static cachestore_dummy::unit_test_configuration |
( |
| ) |
|
|
static |
Generates the appropriate configuration required for unit testing.
- Return values
-
array | Array of unit test configuration data to be used by initialise(). |
Implements cache_store_interface.
◆ $persist
bool cachestore_dummy::$persist = false |
|
protected |
Gets set to true if this store is going to store data.
This happens when the definition doesn't require static acceleration as the loader will not be storing information and something has to.
◆ DEREFERENCES_OBJECTS
const cache_store::DEREFERENCES_OBJECTS = 16 |
|
inherited |
The cache store dereferences objects.
When set, loaders will assume that all data coming from this store has already had all references resolved. So even for complex object structures it will not try to remove references again.
◆ MODE_APPLICATION
const cache_store::MODE_APPLICATION = 1 |
|
inherited |
Application caches.
These are shared caches.
◆ MODE_REQUEST
const cache_store::MODE_REQUEST = 4 |
|
inherited |
Request caches.
Static caches really.
◆ MODE_SESSION
const cache_store::MODE_SESSION = 2 |
|
inherited |
Session caches.
Just access to the PHP session.
The documentation for this class was generated from the following file: