530 Commits

Author SHA1 Message Date
Russell Smith
a169739d5d MDL-56273 cache: Use cache initialise always.
purge_all() and purge_by_definition() look in the configuration
for which caches are available and then creates them to purge them.
The configuration stores the values used by initialise(), not
initialise_unit_test_instance() and would therefore fail to purge
all caches if they were not purged by another means.

In the case of filestore, it's purged by unit tests, in the case
of memcache(d), it purges the whole store when a single definition
is requested.

Therefore all configuration was moved into the configuration file
during unit tests and does not have any special override codes in
the unit test infrastructure.
2016-10-30 13:42:43 +11:00
Tomasz Sanecki
fd7bb5a8d9 MDL-48468 cache: add support for port in server address 2016-10-30 13:34:43 +11:00
Russell Smith
68b1e13094 MDL-48468 cache: Import Redis cachestore
This code was originally taken from; https://github.com/durana/moodle-cachestore_redis
Special thanks to Mark Nielsen and Adam Durana for their work on this.

Since the original import;
- Mode session support has been added.
- Some cleanup of names has been made.
- Data guarantee and references support was added.
2016-10-30 13:34:43 +11:00
Helen Foster
c9636ddd51 MDL-56542 lang: Merge English strings from the en_fix language pack 2016-10-25 20:12:52 +02:00
David Monllao
ab9ca549e7 Merge branch 'wip-mdl-56347' of https://github.com/rajeshtaneja/moodle 2016-10-25 15:20:06 +08:00
Andrew Nicols
9c792b9861 Merge branch 'MDL-55922' of https://github.com/mr-russ/moodle 2016-10-25 15:11:43 +08:00
Russell Smith
ae9e735c77
MDL-56347 caching: Better class variables for notices. 2016-10-21 09:21:11 +08:00
Rajesh Taneja
502b66f53d
MDL-56347 phpunit: Set class for alternative cache store
If alternative cache store is sued, then set the class
and warn user about this.
2016-10-21 09:20:37 +08:00
Eloy Lafuente (stronk7)
b3a089e864 Merge branch 'wip-mdl-56348' of https://github.com/rajeshtaneja/moodle 2016-10-18 01:10:23 +02:00
Rajesh Taneja
ca9a79dae3
MDL-56348 cache: Removed second parameter
There is no second parameter in the api
and identifier should be set by set_identifiers
2016-10-11 12:50:10 +08:00
Eloy Lafuente (stronk7)
209d36cc78 Merge branch 'MDL-56220-m' of https://github.com/micaherne/moodle 2016-10-11 01:17:33 +02:00
Russell Smith
eca7dd65ad MDL-56308 cache: Fix APC ready rules for CLI scripts
When APCu is enabled, but the CLI is not it's possible for
calls to enable APCu to fail because it's not configured on the
command line.
2016-10-07 12:02:37 +11:00
Andrew Nicols
5f21d5e8ab Merge branch 'MDL-39117' of git://github.com/mr-russ/moodle 2016-10-03 10:13:09 +08:00
Michael Aherne
220f1cba3e MDL-56220 cache: Call static method correctly 2016-09-30 14:49:46 +01:00
Frederic Massart
525ef9c8b4 MDL-51948 core: Patch core areas for LTR forms
Part of MDL-55071
2016-09-23 10:55:14 +01:00
Russell Smith
58665ecd62 MDL-39117 cachestore_apcu: Update to APCu
We now use APCu as it's support by PHP7 and provides the
functionality we need.
2016-09-22 11:58:27 +10:00
Sam Hemelryk
cb3e2e144a MDL-39117 cachestore_apc: imported into core 2016-09-20 18:52:03 +10:00
Russell Smith
ec4b83b92a MDL-55922 cache: Improve static cache performance
Static cache has a very flexible storage capability
and does not need all the checks performed on it.
Enabling dereferencing handling and multiple identifiers
removes a lot of unneeded overhead for request caches that
have many get calls.

The changes were modelled on the static acceleration changes
done in MDL-53208.
2016-09-12 11:58:55 +10:00
David Monllao
4b5e0c542a MDL-55604 cache: Updating comment according to code changes 2016-08-24 09:39:15 +08:00
Russell Smith
7ff43e1acf MDL-55604 cache: Fix identifier and cacheable_object
When a cachable object is store in the static cache from
the backing store, it was incorrect serialised rather than
using the wake function.  This has been resolved and tests added.

During the investigation into cacheable_object, it was discovered
that set_identifiers never removes identifiers when you call it,
so set_identifiers(array('a')) and set_identifiers(array('b')) really
resulted in array('a','b') as the identifiers rather than 'b'.

The fix for this issue depends on the set_identifiers fix and
they have been coupled together as a result.
2016-08-24 11:26:20 +10:00
Mark Nelson
e1f53120dd MDL-54984 core_cache: corrected exception message 2016-07-27 11:42:47 +08:00
Jun Pataleta
d6806d8eaf MDL-54984 cache: Added todo tags to items for 3.3 deprecations 2016-07-26 00:46:46 +08:00
Jun Pataleta
329642b9c5 MDL-54984 cache: 3.2 final deprecations 2016-07-26 00:46:37 +08:00
Eloy Lafuente (stronk7)
1abca11e0a MDL-54638 versions: bump all versions and requires near release
version = 2016052300 release version
requires= 2016051900 current rc1 version
2016-05-19 02:16:15 +02:00
Skylar Kelty
216b7f7577 MDL-53967 caching: Ensure getAllKeys returns a valid array 2016-04-29 12:14:34 +01:00
Mark Nelson
027eb38ed5 MDL-48506 cachestore_memcached: make warning more noticeable 2016-04-19 17:11:05 +08:00
Ryan Wyllie
33688fbfe6 MDL-48506 cachestore_memcached: added shared cache config option
When added a memcached instance you can now select whether the cache is
being shared by other applications. The setting will determine the
purging strategy.

Shared caches will have individual keys deleted while dedicated caches
will have the entire cache purged (better performance over networks).

Note: This option only works with the correct version of the php
memcached extension and with the multi-site safe changes.
2016-04-18 07:18:24 +00:00
Sam Hemelryk
7797d7ead0 MDL-48506 cachestore_memcached: added upgrade notice 2016-04-18 06:56:46 +00:00
Sam Hemelryk
957e0c7567 MDL-48506 cachestore_memcached: is now multi-site safe 2016-04-18 06:56:46 +00:00
Michael Aherne
f0ed09852e MDL-53256 cache: Prevent overwriting of cache config with invalid data 2016-04-01 08:52:21 +01:00
Andrew Nicols
ae3c6ee42d MDL-52346 caching: Coding style fixes 2016-02-29 14:14:01 +08:00
Andrew Nicols
8bd28ed696 Merge branch 'MDL-52346' of git://github.com/mr-russ/moodle 2016-02-29 14:12:03 +08:00
Andrew Nicols
d96a4e2a59 MDL-53206 caching: Remove accidental use of fullresult variable 2016-02-29 13:20:29 +08:00
Russell Smith
fdff8077e0 MDL-53208 caching: Update serialization rules for performance.
- We only now serialize when required, eg when the store doesn't do it.
- static acceleration now serializes on set to reduce overhead on load.
- null now works in static acceleration as we use an array for storage metadata
- static acceleration delete uses isset rather than an array_search.
2016-02-28 17:01:51 +11:00
Russell Smith
76349f871e MDL-53208 caching: Remove TTL wrapper on static acceleration.
TTL is only updated between script runs.  If it's valid
when it's added to static acceleration, it will be valid
for the entire script run.
2016-02-28 17:01:50 +11:00
Russell Smith
98d580888b MDL-53208 caching: parse_key not required for static cache.
static cache operates on a single cache instance, it can't share
with others and can use the supplied key immediately.
2016-02-28 17:01:50 +11:00
Russell Smith
80788d03e1 MDL-53208 caching: Update serialization rules for performance.
- We only now serialize when required, eg when the store doesn't do it.
- static acceleration now serializes on set to reduce overhead on load.
- null now works in static acceleration as we use an array for storage metadata
- static acceleration delete uses isset rather than an array_search.
2016-02-28 17:01:50 +11:00
Russell Smith
b2159f2d3f MDL-53208 caching: Enable dereferencing as a feature.
If the cache does all the dereferencing when it stores and loads
the objects, then the cache loaders don't need to do that work.
This is true of all caches that use something other than PHP's memory
to store their results.
2016-02-28 17:01:49 +11:00
Russell Smith
5007975d1e MDL-53206 caching: Ensure get_many and set_many dereference objects. 2016-02-28 17:01:49 +11:00
Russell Smith
4350192a8d MDL-52346 caching: Allow localstorage as a cache option.
We display a notification on screen during configuration telling
the administrator if it's safe to map this store to a local storage
cache or not.
2016-02-26 10:58:20 +11:00
Eloy Lafuente (stronk7)
13cad25081 Merge branch 'MDL-51482-lastinvalidation-handling' of https://github.com/mpetrowi/moodle 2015-11-10 18:27:22 +01:00
Eloy Lafuente (stronk7)
2e144835bb MDL-52059 versions: bump all versions and requires near release
version = planned 2015111600 release version
requires= current 2015111000 rc3 version
2015-11-10 12:33:52 +01:00
Matt Petro
2351ed55e8 MDL-51482 caching: Fix unnecessary updates to lastinvalidation time 2015-10-08 11:48:17 -04:00
David Monllao
7d8edf67ae Merge branch 'wip-MDL-50932-master' of git://github.com/marinaglancy/moodle 2015-08-17 11:43:42 +08:00
Andrew Nicols
6270f4dbdd MDL-50949 cache: Improve cache performance tests 2015-08-10 08:04:03 +08:00
Frederic Massart
47b04bcf7f MDL-50949 cache: Tests for performance debugging of cache usage 2015-07-29 14:38:58 +08:00
Frederic Massart
e75115810c MDL-50949 cache: Performance debug keeps track of hits/misses/sets 2015-07-29 12:56:10 +08:00
Marina Glancy
7b3c5e0e0b MDL-50932 cache: fix bug in prescanned file store
Thanks to Mark Nielsen for providing a patch
2015-07-29 11:23:01 +08:00
David Monllao
b3e6802cf8 MDL-42192 caches: Adding simpledata tests 2015-05-29 17:18:31 +08:00
Marina Glancy
2d1164800c MDL-49572 cache: correctly purge cache on event 2015-05-20 14:07:58 +08:00