mirror of
https://github.com/moodle/moodle.git
synced 2025-01-29 19:50:14 +01:00
MDL-38247 cache: Improved documentation
This commit is contained in:
parent
32c981e67a
commit
11cfc0f95e
11
cache/README.md
vendored
11
cache/README.md
vendored
@ -226,3 +226,14 @@ The first method is designed to be used when you have a single known definition
|
||||
The second method is a lot more intensive for the system. There are defined invalidation events that definitions can "subscribe" to (through the definitions invalidationevents option).
|
||||
When you invalidate by event the cache API finds all of the definitions that subscribe to the event, it then loads the stores for each of those definitions and purges the keys from each store.
|
||||
This is obviously a recursive, and therefore, intense process.
|
||||
|
||||
### Unit tests
|
||||
Both the cache API and the cache stores have unit tests.
|
||||
Please be aware that several of the cache stores require configuration in order to be able operate in the unit tests.
|
||||
Tests for stores requiring configuration that havn't been configured will be skipped.
|
||||
All configuration is done in your sites config.php through definitions.
|
||||
The following snippet illustates how to configure the three core cache stores that require configuration.
|
||||
|
||||
define('TEST_CACHESTORE_MEMCACHE_TESTSERVERS', '127.0.0.1:11211');
|
||||
define('TEST_CACHESTORE_MEMCACHED_TESTSERVERS', '127.0.0.1:11211');
|
||||
define('TEST_CACHESTORE_MONGODB_TESTSERVER', 'mongodb://localhost:27017');
|
@ -15,7 +15,12 @@
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Memcache unit tests
|
||||
* Memcache unit tests.
|
||||
*
|
||||
* If you wish to use these unit tests all you need to do is add the following definition to
|
||||
* your config.php file.
|
||||
*
|
||||
* define('TEST_CACHESTORE_MEMCACHE_TESTSERVERS', '127.0.0.1:11211');
|
||||
*
|
||||
* @package cachestore_memcache
|
||||
* @copyright 2013 Sam Hemelryk
|
||||
|
@ -15,7 +15,12 @@
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Memcached unit tests
|
||||
* Memcached unit tests.
|
||||
*
|
||||
* If you wish to use these unit tests all you need to do is add the following definition to
|
||||
* your config.php file.
|
||||
*
|
||||
* define('TEST_CACHESTORE_MEMCACHED_TESTSERVERS', '127.0.0.1:11211');
|
||||
*
|
||||
* @package cachestore_memcached
|
||||
* @copyright 2013 Sam Hemelryk
|
||||
|
7
cache/stores/mongodb/tests/mongodb_test.php
vendored
7
cache/stores/mongodb/tests/mongodb_test.php
vendored
@ -15,7 +15,12 @@
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* MongoDB unit tests
|
||||
* MongoDB unit tests.
|
||||
*
|
||||
* If you wish to use these unit tests all you need to do is add the following definition to
|
||||
* your config.php file.
|
||||
*
|
||||
* define('TEST_CACHESTORE_MONGODB_TESTSERVER', 'mongodb://localhost:27017');
|
||||
*
|
||||
* @package cachestore_mongodb
|
||||
* @copyright 2013 Sam Hemelryk
|
||||
|
Loading…
x
Reference in New Issue
Block a user