See Release Notes
Long Term Support Release
Differences Between: [Versions 39 and 400] [Versions 39 and 401] [Versions 39 and 402] [Versions 39 and 403]
Cache store - base class This file is part of Moodle's cache API, affectionately called MUC. It contains the components that are required in order to use caching.
Copyright: | 2012 Sam Hemelryk |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 395 lines (13 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
cache_store_interface:: (6 methods):
are_requirements_met()
is_supported_mode()
get_supported_features()
get_supported_modes()
initialise_test_instance()
unit_test_configuration()
cache_store:: (13 methods):
is_ready()
cleanup()
instance_created()
instance_deleted()
can_add_instance()
supports_data_guarantee()
supports_multiple_identifiers()
supports_native_ttl()
is_searchable()
supports_dereferencing_objects()
create_clone()
get_warnings()
ready_to_be_used_for_testing()
Interface: cache_store_interface - X-Ref
Cache store interface.are_requirements_met() X-Ref |
Static method to check if the store requirements are met. return: bool True if the stores software/hardware requirements have been met and it can be used. False otherwise. |
is_supported_mode($mode) X-Ref |
Static method to check if a store is usable with the given mode. param: int $mode One of cache_store::MODE_* |
get_supported_features(array $configuration = array() X-Ref |
Returns the supported features as a binary flag. param: array $configuration The configuration of a store to consider specifically. return: int The supported features. |
get_supported_modes(array $configuration = array() X-Ref |
Returns the supported modes as a binary flag. param: array $configuration The configuration of a store to consider specifically. return: int The supported modes. |
initialise_test_instance(cache_definition $definition) X-Ref |
Generates an instance of the cache store that can be used for testing. Returns an instance of the cache store, or false if one cannot be created. param: cache_definition $definition return: cache_store|false |
unit_test_configuration() X-Ref |
Generates the appropriate configuration required for unit testing. return: array Array of unit test configuration data to be used by initialise(). |
Class: cache_store - X-Ref
Abstract cache store class.is_ready() X-Ref |
Returns true if this cache store instance is ready to use. return: bool |
cleanup() X-Ref |
instance_created() X-Ref |
Performs any necessary operation when the store instance has been created. |
instance_deleted() X-Ref |
Performs any necessary operation when the store instance is being deleted. This method may be called before the store has been initialised. |
can_add_instance() X-Ref |
Returns true if the user can add an instance of the store plugin. return: bool |
supports_data_guarantee() X-Ref |
Returns true if the store instance guarantees data. return: bool |
supports_multiple_identifiers() X-Ref |
Returns true if the store instance supports multiple identifiers. return: bool |
supports_native_ttl() X-Ref |
Returns true if the store instance supports native ttl. return: bool |
is_searchable() X-Ref |
Returns true if the store instance is searchable. return: bool |
supports_dereferencing_objects() X-Ref |
Returns true if the store automatically dereferences objects. return: bool |
create_clone(array $details = array() X-Ref |
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. param: array $details An array containing the details of the store from the cache config. return: cache_store |
get_warnings() X-Ref |
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: string[] An array of warning strings from the store instance. |
ready_to_be_used_for_testing() X-Ref |
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: bool |