340 Commits

Author SHA1 Message Date
Helen Foster
7f6accd448 MDL-56903 lang: Merge English strings from the en_fix language pack 2016-11-15 11:19:48 +01:00
Dan Poltawski
6765172ed1 NOBUG: Fixed file access permissions 2016-11-04 11:20:33 +00:00
Andrew Nicols
70aa00de87 MDL-56748 cache: Removes cache definition instances in purge_store
Previously a purge_store was only purging caches but it was leaving a
reference to the store instance for the cache definition.

As a result, the cache was never cleared away correctly and, in cases
where the cache store makes a TCP connection to a backend system, the
number of open sockets was increasing for each store instance.

After a complete purge, as found in the unit test reset, the cache
definitions should be both purged and removed.

This change should also lead to a drop in memory consumption for unit
tests as there will no longer be references to unused definition stores.
2016-11-04 13:26:46 +08:00
Andrew Nicols
8fa816e0b0 Merge branch 'wip-mdl-56273' of https://github.com/rajeshtaneja/moodle 2016-11-02 14:30:08 +08:00
Rajesh Taneja
4a910b9aa6
MDL-56273 cache: Fixed initialise call
After store is created, it should be checked if
it's ready before calling initialise
2016-11-02 14:26:50 +08:00
Andrew Nicols
c6ae02c184 Merge branch 'MDL-48468' of https://github.com/mr-russ/moodle 2016-11-02 10:13:42 +08:00
Andrew Nicols
326b285467 Merge branch 'MDL-56273' of https://github.com/mr-russ/moodle 2016-11-01 10:55:23 +08:00
Dan Poltawski
f2263f7c06 Merge branch 'MDL-56542-master-enfix' of git://github.com/mudrd8mz/moodle 2016-10-31 15:15:09 +00:00
Russell Smith
a330e83ade MDL-56273 cache: Use is_ready() to determine if cache is really ready. 2016-10-31 19:44:05 +11:00
Russell Smith
f9599c77cc MDL-56273 cache: Ensure requirements are met for cache stores.
Ensure that the cache store requirements are met prior to attempting
to instantiate a class.  Many of the constructors create connections
to external services requiring the installation and availability of
classes that are specified in are_requirements_met().  If they are
not checked properly you end up with PHP Fatal errors rather than
falling back to a different store that is capabable without the
the extra classes loaded.
2016-10-31 16:04:51 +11:00
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