Skip to content

Commit

Permalink
MDL-77350 cache: Added class properties that are not declared
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
meirzamoodle committed May 15, 2023
1 parent 00bea84 commit 691d80f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cache/classes/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions cache/classes/dummystore.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -119,6 +125,8 @@ public function initialise(cache_definition $definition) {
} else {
$this->persist = !$definition->use_static_acceleration();
}

$this->definition = $definition;
}

/**
Expand Down
13 changes: 13 additions & 0 deletions cache/classes/loaders.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down

0 comments on commit 691d80f

Please sign in to comment.