mirror of
https://github.com/moodle/moodle.git
synced 2025-07-16 20:06:30 +02:00
Revert "MDL-43349 cache: is_ready now checks are_requirements_met by default"
This reverts commit 2201c02d73
.
This commit is contained in:
8
cache/classes/dummystore.php
vendored
8
cache/classes/dummystore.php
vendored
@@ -129,6 +129,14 @@ class cachestore_dummy extends cache_store {
|
|||||||
return (!empty($this->definition));
|
return (!empty($this->definition));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if this is ready.
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function is_ready() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true the given mode is supported.
|
* Returns true the given mode is supported.
|
||||||
* @param int $mode
|
* @param int $mode
|
||||||
|
2
cache/classes/factory.php
vendored
2
cache/classes/factory.php
vendored
@@ -274,7 +274,7 @@ class cache_factory {
|
|||||||
}
|
}
|
||||||
/* @var cache_store $store */
|
/* @var cache_store $store */
|
||||||
$store = $this->stores[$name];
|
$store = $this->stores[$name];
|
||||||
if (!$store->is_ready() || !$store->is_supported_mode($definition->get_mode())) {
|
if (!$store::are_requirements_met() || !$store->is_ready() || !$store->is_supported_mode($definition->get_mode())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// We always create a clone of the original store.
|
// We always create a clone of the original store.
|
||||||
|
2
cache/classes/helper.php
vendored
2
cache/classes/helper.php
vendored
@@ -470,7 +470,7 @@ class cache_helper {
|
|||||||
// Found the store: is it ready?
|
// Found the store: is it ready?
|
||||||
/* @var cache_store $instance */
|
/* @var cache_store $instance */
|
||||||
$instance = new $class($store['name'], $store['configuration']);
|
$instance = new $class($store['name'], $store['configuration']);
|
||||||
if (!$instance->is_ready()) {
|
if (!$instance::are_requirements_met() || !$instance->is_ready()) {
|
||||||
unset($instance);
|
unset($instance);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
4
cache/classes/store.php
vendored
4
cache/classes/store.php
vendored
@@ -179,9 +179,7 @@ abstract class cache_store implements cache_store_interface {
|
|||||||
* Returns true if this cache store instance is ready to use.
|
* Returns true if this cache store instance is ready to use.
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function is_ready() {
|
abstract public function is_ready();
|
||||||
return self::are_requirements_met();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves an item from the cache store given its key.
|
* Retrieves an item from the cache store given its key.
|
||||||
|
8
cache/stores/session/lib.php
vendored
8
cache/stores/session/lib.php
vendored
@@ -222,6 +222,14 @@ class cachestore_session extends session_data_store implements cache_is_key_awar
|
|||||||
return (is_array($this->store));
|
return (is_array($this->store));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if this store instance is ready to be used.
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function is_ready() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves an item from the cache store given its key.
|
* Retrieves an item from the cache store given its key.
|
||||||
*
|
*
|
||||||
|
8
cache/stores/static/lib.php
vendored
8
cache/stores/static/lib.php
vendored
@@ -217,6 +217,14 @@ class cachestore_static extends static_data_store implements cache_is_key_aware,
|
|||||||
return (is_array($this->store));
|
return (is_array($this->store));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if this store instance is ready to be used.
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function is_ready() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves an item from the cache store given its key.
|
* Retrieves an item from the cache store given its key.
|
||||||
*
|
*
|
||||||
|
3
cache/upgrade.txt
vendored
3
cache/upgrade.txt
vendored
@@ -1,9 +1,6 @@
|
|||||||
This files describes API changes in /cache/stores/* - cache store plugins.
|
This files describes API changes in /cache/stores/* - cache store plugins.
|
||||||
Information provided here is intended especially for developers.
|
Information provided here is intended especially for developers.
|
||||||
|
|
||||||
=== 2.7 ===
|
|
||||||
* cache_store::is_ready is no longer abstract, calling cache_store::are_requirements_met by default.
|
|
||||||
|
|
||||||
=== 2.6 ===
|
=== 2.6 ===
|
||||||
* All cache instances are recorded and subsequent requests are given a reference to the original instance.
|
* All cache instances are recorded and subsequent requests are given a reference to the original instance.
|
||||||
* The persistent option for the cache definition has been deprecated. Please use the staticacceleration option instead.
|
* The persistent option for the cache definition has been deprecated. Please use the staticacceleration option instead.
|
||||||
|
Reference in New Issue
Block a user