From b5f98e022d2261cb9ea538ee38239efdc9f87256 Mon Sep 17 00:00:00 2001 From: Meirza Date: Thu, 19 Jan 2023 22:15:18 +0700 Subject: [PATCH] MDL-77350 cache: Added class properties that are not declared In PHP 8.2 and later, setting a value to an undeclared class property is deprecated and emits a deprecation notice. So we need to add missing class properties that still need to be declared. --- cache/classes/config.php | 6 ++++++ cache/classes/dummystore.php | 8 ++++++++ cache/classes/loaders.php | 13 +++++++++++++ 3 files changed, 27 insertions(+) diff --git a/cache/classes/config.php b/cache/classes/config.php index 021e2a69dd9..115b5ef3869 100644 --- a/cache/classes/config.php +++ b/cache/classes/config.php @@ -65,6 +65,12 @@ class cache_config { */ protected $configdefinitionmappings = array(); + /** + * The locking mappings that have been configured. + * @var array + */ + protected $configlockmappings = []; + /** * An array of configured cache lock instances. * @var array diff --git a/cache/classes/dummystore.php b/cache/classes/dummystore.php index bcc9ca1e72f..f268cef50c9 100644 --- a/cache/classes/dummystore.php +++ b/cache/classes/dummystore.php @@ -59,6 +59,12 @@ class cachestore_dummy extends cache_store { */ protected $store = array(); + /** + * Cache definition + * @var cache_definition + */ + protected $definition; + /** * Constructs a dummy store instance. * @param string $name @@ -119,6 +125,8 @@ class cachestore_dummy extends cache_store { } else { $this->persist = !$definition->use_static_acceleration(); } + + $this->definition = $definition; } /** diff --git a/cache/classes/loaders.php b/cache/classes/loaders.php index b008ae1079b..8f32d6560da 100644 --- a/cache/classes/loaders.php +++ b/cache/classes/loaders.php @@ -173,6 +173,19 @@ class cache implements cache_loader { */ protected $subloader = false; + /** + * Gets set to true if the cache writes (set|delete) must have a manual lock created first. + * @var bool + */ + protected $requirelockingbeforewrite = false; + + /** + * Gets set to true if the cache's primary store natively supports locking. + * If it does then we use that, otherwise we need to instantiate a second store to use for locking. + * @var cache_store|null + */ + protected $nativelocking = null; + /** * Creates a new cache instance for a pre-defined definition. *