protected $datasourcefile = null;
/**
- * The data source class aggregate to use. This is a super advanced setting.
+ * Deprecated - this is completely unused.
+ * @deprecated since 2.9
* @var string
*/
protected $datasourceaggregate = null;
*
* @param string $id
* @param array $definition
- * @param string $datasourceaggregate
+ * @param string $unused Used to be datasourceaggregate but that was removed and this is now unused.
* @return cache_definition
* @throws coding_exception
*/
- public static function load($id, array $definition, $datasourceaggregate = null) {
+ public static function load($id, array $definition, $unused = null) {
global $CFG;
if (!array_key_exists('mode', $definition)) {
$cachedefinition->overrideclassfile = $overrideclassfile;
$cachedefinition->datasource = $datasource;
$cachedefinition->datasourcefile = $datasourcefile;
- $cachedefinition->datasourceaggregate = $datasourceaggregate;
$cachedefinition->staticacceleration = $staticacceleration;
$cachedefinition->staticaccelerationsize = $staticaccelerationsize;
$cachedefinition->ttl = $ttl;
* @param string $component
* @param string $area
* @param array $identifiers
- * @param string $aggregate
+ * @param string $unused Used to be data source aggregate however that was removed and this is now unused.
* @return cache_application|cache_session|cache_request
*/
- public function create_cache_from_definition($component, $area, array $identifiers = array(), $aggregate = null) {
+ public function create_cache_from_definition($component, $area, array $identifiers = array(), $unused = null) {
$definitionname = $component.'/'.$area;
if (isset($this->cachesfromdefinitions[$definitionname])) {
$cache = $this->cachesfromdefinitions[$definitionname];
$cache->set_identifiers($identifiers);
return $cache;
}
- $definition = $this->create_definition($component, $area, $aggregate);
+ $definition = $this->create_definition($component, $area);
$definition->set_identifiers($identifiers);
$cache = $this->create_cache($definition, $identifiers);
// Loaders are always held onto to speed up subsequent requests.
* Creates a definition instance or returns the existing one if it has already been created.
* @param string $component
* @param string $area
- * @param string $aggregate
+ * @param string $unused This used to be data source aggregate - however that functionality has been removed and
+ * this argument is now unused.
* @return cache_definition
+ * @throws coding_exception If the definition cannot be found.
*/
- public function create_definition($component, $area, $aggregate = null) {
+ public function create_definition($component, $area, $unused = null) {
$id = $component.'/'.$area;
- if ($aggregate) {
- $id .= '::'.$aggregate;
- }
if (!isset($this->definitions[$id])) {
// This is the first time this definition has been requested.
if ($this->is_initialising()) {
// To serve this purpose and avoid errors we are going to make use of an ad-hoc cache rather than
// search for the definition which would possibly cause an infitite loop trying to initialise the cache.
$definition = cache_definition::load_adhoc(cache_store::MODE_REQUEST, $component, $area);
- if ($aggregate !== null) {
- // If you get here you deserve a warning. We have to use an ad-hoc cache here, so we can't find the definition and therefor
- // can't find any information about the datasource or any of its aggregated.
- // Best of luck.
- debugging('An unknown cache was requested during development with an aggregate that could not be loaded. Ad-hoc cache used instead.', DEBUG_DEVELOPER);
- $aggregate = null;
- }
} else {
// Either a typo of the developer has just created the definition and is using it for the first time.
$this->reset();
debugging('Cache definitions reparsed causing cache reset in order to locate definition.
You should bump the version number to ensure definitions are reprocessed.', DEBUG_DEVELOPER);
}
- $definition = cache_definition::load($id, $definition, $aggregate);
+ $definition = cache_definition::load($id, $definition);
}
} else {
- $definition = cache_definition::load($id, $definition, $aggregate);
+ $definition = cache_definition::load($id, $definition);
}
}
$this->definitions[$id] = $definition;
/**
* Purges the cache for a specific definition.
*
- * If you need to purge a definition that requires identifiers or an aggregate and you don't
- * know the details of those please use cache_helper::purge_stores_used_by_definition instead.
- * It is a more aggressive purge and will purge all data within the store, not just the data
- * belonging to the given definition.
- *
- * @todo MDL-36660: Change the signature: $aggregate must be added.
- *
* @param string $component
* @param string $area
* @param array $identifiers
// Initialise, in case of a store.
if ($cache instanceof cache_store) {
$factory = cache_factory::instance();
- // TODO MDL-36660: Providing $aggregate is required for purging purposes: $definition->get_id()
$definition = $factory->create_definition($component, $area, null);
$definition->set_identifiers($identifiers);
$cache->initialise($definition);
* @param string $component The component for the definition
* @param string $area The area for the definition
* @param array $identifiers Any additional identifiers that should be provided to the definition.
- * @param string $aggregate Super advanced feature. More docs later.
+ * @param string $unused Used to be datasourceaggregate but that was removed and this is now unused.
* @return cache_application|cache_session|cache_store
*/
- public static function make($component, $area, array $identifiers = array(), $aggregate = null) {
+ public static function make($component, $area, array $identifiers = array(), $unused = null) {
$factory = cache_factory::instance();
- return $factory->create_cache_from_definition($component, $area, $identifiers, $aggregate);
+ return $factory->create_cache_from_definition($component, $area, $identifiers);
}
/**
*
* @param string $component
* @param string $area
- * @param string $aggregate Unused.
+ * @param string $unused Used to be datasourceaggregate but that was removed and this is now unused.
* @return cache_definition
*/
- public function create_definition($component, $area, $aggregate = null) {
+ public function create_definition($component, $area, $unused = null) {
return cache_definition::load_adhoc(cache_store::MODE_REQUEST, $component, $area);
}
* @param string $component
* @param string $area
* @param array $identifiers
- * @param string $aggregate
+ * @param string $unused Used to be datasourceaggregate but that was removed and this is now unused.
* @return cache_application|cache_session|cache_request
*/
- public function create_cache_from_definition($component, $area, array $identifiers = array(), $aggregate = null) {
- $definition = $this->create_definition($component, $area, $aggregate);
+ public function create_cache_from_definition($component, $area, array $identifiers = array(), $unused = null) {
+ $definition = $this->create_definition($component, $area);
$cache = $this->create_cache($definition, $identifiers);
return $cache;
}
This files describes API changes in /cache/stores/* - cache store plugins.
Information provided here is intended especially for developers.
+=== 2.9 ===
+* Cache data source aggregation functionality has been removed. This functionality was found to be broken and unused.
+ It was decided that rather than fixing it it should be removed.
+ As well as the processing code being removed the following API changes have been made.
+ The following changes have come about because of it:
+ - cache_definition::$datasourceaggregate is deprecated an unused.
+ - cache_definition::load Argument 3 (final arg) is now unused.
+ - cache_factory::create_cache_from_definition Argument 4 (final arg) is now unused.
+ - cache::make Argument 4 (final arg) is now unused.
+
=== 2.7 ===
* cache_store::is_ready is no longer abstract, calling cache_store::are_requirements_met by default.