The static cache store supports_multiple_identifiers() and a multi-identifier array is generated in generate_multi_key_parts but only the key provided to $cache->get is used to retrieve the key from the static cache.
The storeid generated by cachestore_static::initialise() does not use the identifiers provided in cache::make().
The identifiers provided in cache::make() are used in generate_single_key_prefix, but this function is only used for cache stores that do not support multiple identifiers.
I haven't checked other cache stored, but my conclusion is that cache stores that support multiple identifiers and do not make internal use of the multiple identifiers when setting or getting items do not really support identifiers. This is a problem because, for what I understand, $identifiers are supposed to use for all definitions and all cache stores.
https://github.com/dmonllao/moodle/compare/MDL-65358_master~...MDL-65358_master
<?php
|
|
define('CLI_SCRIPT', true);
|
require_once(__DIR__ . '/config.php');
|
|
/**
|
* The same issue exists with cache::make() regardless of the cache definition params.
|
*/
|
|
$identifiers = ['one' => 'yeah'];
|
$cache = cache::make_from_params(cache_store::MODE_REQUEST, 'core', 'testwithidentifiers', $identifiers);
|
$cache->set('itemkey', 'FIRST');
|
|
// Different identifiers.
|
$identifiers = ['one' => 'not-yeah'];
|
$cache = cache::make_from_params(cache_store::MODE_REQUEST, 'core', 'testwithidentifiers', $identifiers);
|
|
echo 'It should not return stuff when using different identifiers, but...' . PHP_EOL;
|
echo $cache->get('itemkey') . PHP_EOL;
|
- has been marked as being related by
-
MDL-65348 Insights about upcoming activities due should be generated from time()
- Closed