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
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.
This reverts commit 89182546a0ae93a2aef79383bac902c77c7801f8.
This reverts commit 170b05362a82b2c1f5353551b7bd6fe4246fe951.
This reverts commit 2e9d5a534e8e3045923055baa1609d66cec0affe.
- 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
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.
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.
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.