Commit Graph

51 Commits

Author SHA1 Message Date
Russell Smith a8ee2c885d MDL-53206 caching: Ensure get_many and set_many dereference objects. 2016-02-29 15:59:21 +11:00
Matt Petro 2351ed55e8 MDL-51482 caching: Fix unnecessary updates to lastinvalidation time 2015-10-08 11:48:17 -04: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
David Monllao b3e6802cf8 MDL-42192 caches: Adding simpledata tests 2015-05-29 17:18:31 +08:00
Eloy Lafuente (stronk7) 093c161d46 Merge branch '45699-29' of git://github.com/samhemelryk/moodle
Conflicts:
	cache/upgrade.txt
2014-12-23 02:01:36 +01:00
Eloy Lafuente (stronk7) 57bd925603 MDL-48568 cache: make tests aware of default application store
When an alternative cache configuration is used, aka:

define('TEST_CACHE_USING_ALT_CACHE_CONFIG_PATH', true);
$CFG->altcacheconfigpath = '/tmp/xxxxx.php';

the get_expected_application_cache_store() method was not able of
retroffiting the default application store being used.

This commit just implements that functionality so, when
executing unit tests using alternative configuration, assertions
looking for that will pass without a problem.
2014-12-23 01:34:35 +01:00
Sam Hemelryk 427c41ef2d MDL-45699 cache: renamed cache_config_phpunittest
Renamed cache_config_phpunittest to cache_config_testing
2014-12-09 10:51:38 +13:00
Sam Hemelryk eefb680d8e MDL-45513 cache: implemented defines for unit testing alternative caches 2014-05-30 08:41:07 +12:00
Sam Hemelryk 79a8ea653c MDL-45513 cache: added support to unit tests for alt cache stores 2014-05-30 08:41:07 +12:00
Eric Merrill e39099ac36 MDL-45603 cache Fix the mappingsonly option to work as advertised. 2014-05-17 23:48:33 -04:00
Sam Hemelryk 7310a6637a MDL-41997 cache: added unit tests for disabled stores 2013-09-30 09:41:03 +13:00
Sam Hemelryk b51fed38f2 MDL-40903 cache: renamed loader method to reflect static accelerator 2013-09-25 09:05:18 +12:00
Sam Hemelryk d074fb091d MDL-40903 cache: renamed persistcache to staticacceleration 2013-09-25 09:05:18 +12:00
Marina Glancy d67a1a8815 MDL-40903 cache: Unittests and small fixes for persistent application cache 2013-09-25 09:04:36 +12:00
Sam Hemelryk 083fa87759 MDL-40903 cache: converted persistent into persistentdata
At the same time all cache instances were made persistent
2013-09-25 09:04:35 +12:00
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
Damyon Wiese 5ebe37fb27 Revert "MDL-41106 cache: several fixes for the session cache."
This reverts commit 89182546a0.
This reverts commit 170b05362a.
This reverts commit 2e9d5a534e.
2013-08-19 15:32:08 +08:00
Sam Hemelryk 89182546a0 MDL-41106 cache: tidied up several elements 2013-08-19 11:32:08 +12:00
Petr Škoda 8252b7c291 MDL-40901 standardise core test case class and file names
This finally allows us to type only the class name when executing individual core test cases.
2013-08-04 22:10:31 +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) 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
Sam Hemelryk 4a749e93b4 MDL-40555 cache: implemented unit tests for default search functionality 2013-07-16 08:29:17 +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
Sam Hemelryk 045fe95c63 MDL-39525 cache: fixed purging definitions requiring identifiers 2013-05-07 15:11:33 +12:00
Sam Hemelryk 5f5776c1e6 MDL-37500 cache: integration review touchups.
Issues:
1. Fix setType calls
2. Changing from default to all and editing again, default is still selected.
3. Uncheck all options causes error.
4. Doesn't seem to be restricting based upon option.
5. Picked all and got coding error with the database thing.
6. Bad title: https://github.com/samhemelryk/moodle/commit/wip-MDL-37500-m25#L1R157
7. Amend comments - should only be removed once 2.5 is the minimum version for an upgrade.
8. Document the defaultsharing option.

Outcomes:
1. Fixed - copy paste error.
2. Fixed - mforms was applying the default value despite a value being provided. A quirk of elements with array names.
3. Fixed - validation now requires at least one option to be selected.
4. Fixed - issue rose from definitions not being re-parsed. cache/admin.php now reparses the first time a user visits the page.
5. Fixed - better purging of definitions when working with them anonymously. Unit test added.
6. Fixed - new string added and used.
7. Fixed - comments amended.

New issue to address parsing of definitions during upgrade.
New issue to add debugging notice if definition sets only one possible sharing option and that option is user input.
2013-05-07 12:49:12 +12:00
Sam Hemelryk 5cba0c4ba3 MDL-38565 cache: tidy up pre-integration 2013-04-19 10:13:36 +12: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
Sam Hemelryk 35b2d0db5e MDL-38303 cache: fixed purging of session cache when switching users 2013-03-10 11:31:26 +13:00
Damyon Wiese be98769eab Merge branch 'wip-MDL-37903-m25' of git://github.com/samhemelryk/moodle 2013-03-05 13:12:12 +08:00
Sam Hemelryk 0323e1ab99 MDL-38165 cache: added unit tests for event purging of persistent caches 2013-03-01 11:38:02 +13:00
Sam Hemelryk 01a3333723 MDL-37903 cache: implemented cacheable_object_array 2013-03-01 10:09:06 +13:00
Eloy Lafuente (stronk7) c45593c6d8 Merge branch 'wip-MDL-38110-m25' of git://github.com/samhemelryk/moodle 2013-02-26 00:48:22 +01:00
Sam Hemelryk 0bdf592e6e MDL-38110 cache: increased ttl unit test value to avoid timing issues 2013-02-21 09:53:02 +13:00
Sam Hemelryk e0d9b7c0d4 MDL-37683 cache: siteidentifier is now included in the keys 2013-02-18 08:32:03 +13:00
Sam Hemelryk 956d3544f0 MDL-36363 cache: added unit tests for muliple loaders 2013-01-31 12:16:08 +13:00
Sam Hemelryk 94ef67cf5f MDL-36466 cache: tidy up after review 2012-11-26 08:12:00 +13:00
Sam Hemelryk 3680c61a3c MDL-36466 cache: implemented functionality to disable the bulk of the cache API 2012-11-26 08:12:00 +13:00
Sam Hemelryk 82afd05c35 MDL-36466 cache: renamed disable to disable_stores and added tests 2012-11-26 08:12:00 +13:00
Sam Hemelryk 702651c7a6 MDL-36120 cache: Tidied up post peer-review 2012-11-07 10:03:32 +13:00
Sam Hemelryk 47834bcd41 MDL-36120 cache: now uses sha1 and has an option for simple keys 2012-11-07 10:03:32 +13:00
Sam Hemelryk e0a568e281 MDL-36094 cache: Fixed up inclusion path for overrideclassfile and datasourcefile 2012-10-19 08:11:40 +08:00
Sam Hemelryk 267ebe02b3 MDL-25290 cache: Fixed issues with references when getting, and added unit tests to cover 2012-10-08 09:53:53 +13:00
Sam Hemelryk 42f2c59eb8 MDL-25290 cache: Added unit tests for admin and fixed up identified issues 2012-10-08 09:53:52 +13:00
Sam Hemelryk 8dbfbd71c9 MDL-25290 cache: Fixed up handling of objects by cache loader 2012-10-08 09:53:52 +13:00
Sam Hemelryk 170f821b9d MDL-25290 cache: Fixed things up per coding style 2012-10-08 09:53:52 +13:00
Sam Hemelryk 167ad91e86 MDL-25290 cache: Added UI to view the cache lock setups and tidied up a couple of things 2012-10-08 09:53:51 +13:00
Sam Hemelryk 34c84c723a MDL-25290 cache: Added cache locking plugin and converted locking implementations to that 2012-10-08 09:53:51 +13:00
Sam Hemelryk 6fec18203b MDL-25290 cache: Renamed plugin from cache => cachestore 2012-10-08 09:53:51 +13:00
Sam Hemelryk 52642d0d24 MDL-25290 cache: Fixed up issue with unit test blowing away cachedir 2012-10-08 09:53:51 +13:00