225 Commits

Author SHA1 Message Date
Sam Hemelryk
85008bedd5 MDL-41106 cache: several fixes for the session cache.
This issue makes several fixes for the session loader and the session store.
 * maxsize argument now works for session caches.
 * fixed performance hole when interation occurs frequently.
 * fixed cache purge bug occuring when multiple caches are defined before being used.
 * improved lastaccess handling.

Big thanks to Marina who contributed the following commits:
 * Always make sure the elements in cache are sorted so we need to remove only elements in the beginning of array
 * Remove expired elements from session store to free memory
 * Minor bug fixes
2013-08-26 09:15:57 +12:00
Matteo Scaramuccia
a94bc886bb MDL-41410 Caching: move comment to the appropriate place.
MDL-38162 fixes the issue about testing the connection to the memcached
daemon, which means testing once the connection to the pool of servers
and not to each of the servers while being added to the pool.
It misses to move the comment to that code too.
2013-08-25 14:00:47 +02:00
Russell Smith
90048725b0 MDL-41291 cache: Use fread to avoid race conditions 2013-08-19 20:18:57 +10:00
Frederic Massart
cbb3990bcb MDL-41071 core: plugininfo_mod caches in plugininfo_mod definition 2013-08-07 20:55:22 +08:00
Sam Hemelryk
609bda269e Merge branch 'w31_MDL-40891_m26_mkdirrace' of https://github.com/skodak/moodle 2013-07-29 11:53:02 +12:00
Petr Škoda
6763fde8d4 MDL-40891 prevent exceptions when creating directories in file store
Even if cache creation fails moodle should continue working.
2013-07-26 20:28:57 +02:00
Damyon Wiese
05b659b252 MDL-40727 Cache: Fix file cache store on windows. 2013-07-24 17:04:44 +08:00
Eloy Lafuente (stronk7)
154bc6b240 Merge branch 'w30_MDL-40642_m26_umask' of https://github.com/skodak/moodle 2013-07-23 23:42:11 +02:00
Eloy Lafuente (stronk7)
e71c47bf8c MDL-40700 tests: skip if there is not instance
Various reasons can lead to the cache stores not being available
(missing extension, configuration...). Under those situations
the test must be skipped because for sure it will break if
we continue.
2013-07-23 17:00:02 +02:00
Eloy Lafuente (stronk7)
9e1e94aafa Merge branch 'wip-MDL-40700-m26' of git://github.com/samhemelryk/moodle 2013-07-23 13:58:20 +02:00
Eloy Lafuente (stronk7)
d4731fd002 Merge branch 'wip-MDL-40677-m26' of git://github.com/samhemelryk/moodle 2013-07-23 12:52:50 +02:00
Sam Hemelryk
deeae9c155 Merge branch 'MDL-40680-master' of git://github.com/danpoltawski/moodle 2013-07-23 14:14:27 +12:00
Sam Hemelryk
67da59999a MDL-40677 cache: fixed bug with maxsize when setting 2013-07-22 10:42:04 +12:00
Sam Hemelryk
6f6a8dd19e MDL-40677: cachestore_static: implemented support for maxsize 2013-07-22 10:42:04 +12:00
Sam Hemelryk
cb3590091e MDL-40677: cachestore_session: implemented support for maxsize 2013-07-22 10:42:04 +12:00
Sam Hemelryk
7dfa10b02e MDL-40700 cache: memcache and memcached stores now allow alphanumext prefixes 2013-07-22 10:41:38 +12:00
Chris Wharton
a423acd95c MDL-40700 cache: Validate memcache key prefix field 2013-07-22 10:41:37 +12:00
Petr Škoda
eb1ee665f6 MDL-40642 use this->cfg in local file store when fixing permissions 2013-07-19 09:18:44 +02:00
Petr Škoda
eb459f7192 MDL-40642 set more restrictive umask and use proper permission for new dirs and files 2013-07-19 09:18:44 +02:00
Eloy Lafuente (stronk7)
3f0a8871d3 Merge branch 'MDL-40555-master' of git://github.com/FMCorz/moodle
Conflicts:
	cache/stores/static/lib.php
2013-07-16 09:57:34 +02:00
Dan Poltawski
a10d6199c8 MDL-40680 store_memcached: fix serialiser options
* Use correct lang string for SERIALIZER_IGBINARY
* Use PARAM_INT for the parameter
2013-07-16 09:37:53 +08:00
Russell Smith
ae21341523 MDL-40538 caching: Use isset for performance
isset is much faster than array_key_exists. For caches we need to
ensure as much performance as possible. To all null to continue to
be stored and provide correct results, non ttl also now saves in
$this->store[$key][0].  As isset($this->store[$key]) will return
true in all cases.

time() as found in cache::now() can be slow on some platforms and
we shouldn't bother checking it unless needed. It also stops non-ttl
caches paying the ttl price.

Unit tests were adjusted to ensure null is still handled correctly
when we are only using isset.
2013-07-10 10:15:19 +10:00
Frederic Massart
0d8eac408b MDL-40555 cache: Static store is searchable 2013-07-08 15:09:04 +08:00
Sam Hemelryk
1878661402 MDL-40100 cache: removed unneeded includes from add instance forms 2013-06-10 10:23:28 +12:00
Sam Hemelryk
9aacf24b62 MDL-39456 cachestore_file: added reference to global $CFG
By holding onto a reference of the global $CFG object we
can be sure that it isn't destroyed before we are done
with it.
This allows for caches to be used within destructors for
purposes such as delayed writes.
2013-05-24 09:51:11 +12:00
Helen Foster
9f3e096899 MDL-39642 Merge English strings from the en_fix language pack 2013-05-13 09:58:43 +02:00
Dan Poltawski
ac15fc95fa Merge branch 'MDL-39448-master' of git://github.com/sammarshallou/moodle
Conflicts:
	cache/stores/memcache/version.php
2013-05-07 11:43:23 +01:00
Dan Poltawski
2da94da7b5 Merge branch 'MDL-39473-master' of git://github.com/sammarshallou/moodle 2013-05-06 14:32:33 +01:00
sam marshall
cb86f1ebb3 MDL-39472 MUC: Improve parse_key performance 2013-05-02 16:04:29 +01:00
Eloy Lafuente (stronk7)
cedb0aab5a MDL-39434 Bump all versions near 2.5 release 2013-05-01 18:03:29 +02:00
sam marshall
c797c995a0 MDL-39448 MUC: Memcache configurable key names 2013-05-01 14:29:11 +01:00
Sam Hemelryk
dbd2ea4e1f MDL-38565 cache: session caches now function as expected
This change is a large change to the way sessions are handled
within MUC after it was discovered that session did not function
as expected when any store other than the default session store
was being used.
As part of this change the session loader has been largely
customised in order to consolidate session data for the loader.
The unit tests have also being greatly increased to provide
better coverage for sessions.
2013-04-19 10:11:48 +12:00
Eloy Lafuente (stronk7)
caa5bcea00 Merge branch 'wip-MDL-38247-m25' of git://github.com/samhemelryk/moodle 2013-03-05 01:08:23 +01:00
Sam Hemelryk
11cfc0f95e MDL-38247 cache: Improved documentation 2013-03-01 10:11:55 +13:00
Sam Hemelryk
32c981e67a MDL-38247 cache: fixed cache stores so that they pass unit tests 2013-03-01 10:11:55 +13:00
Sam Hemelryk
ac6754a679 MDL-38427 cache: implemented unit tests for all core cache stores 2013-03-01 10:11:55 +13:00
Sam Hemelryk
4af3d7e7a3 MDL-38205 cache: implemented key prefix in memcache plugin 2013-03-01 10:11:45 +13:00
Sam Hemelryk
ff6f9d3aa6 MDL-38162 memcache: fixed up the memcache plugins 2013-02-22 14:23:18 +13:00
Sam Hemelryk
bb4c391688 MDL-37645 cache: fixed issue deleting mongo instance 2013-02-08 08:06:21 +13:00
Sam Hemelryk
5dfa3031a8 MDL-36322 cache: clarified docs for initialise and construct 2013-02-01 08:49:03 +13:00
Sam Hemelryk
65b3edc450 MDL-36322 cache: cache stores now test connections during construction 2013-02-01 08:49:03 +13:00
Matteo Scaramuccia
f4cec2ec87 MDL-36322 Errors when updating a Moodle instance with some misconfigured cache stores 2013-02-01 08:49:03 +13:00
Sam Hemelryk
a037c943bd MDL-36363 cache: clean up pre-integration 2013-01-28 10:39:23 +13:00
Matteo Scaramuccia
59ca73ff82 MDL-36363 Override instance_deleted() for all cache stores performing just a cleanup() when this action successfully applies over all the definitions of the cache store 2013-01-28 10:39:23 +13:00
Matteo Scaramuccia
56e65baa1e MDL-36363 Adding/Removing a file store cache instance cleanups the folder too 2013-01-28 10:39:23 +13:00
Brian King
6e89fb0309 MDL-37225 reset cachstore_static store when purging 2012-12-18 23:57:22 +01:00
Eloy Lafuente (stronk7)
663dbbc2e6 MDL-36933 Bump everything to 2012112900
(versions, requires and dependencies)
2012-11-30 03:30:09 +01:00
Dan Poltawski
f95fb4b600 Merge branch 'wip-MDL-36825-m24' of git://github.com/samhemelryk/moodle 2012-11-27 13:37:49 +08:00
Sam Hemelryk
b144e12feb MDL-36768 cache: Fixed regression in cache stores by reordering classes 2012-11-27 12:14:48 +13:00
Sam Hemelryk
e4f71b7c8f MDL-36825 cachestore_file: fixed isready condition check 2012-11-27 10:16:08 +13:00