Skip to content

Commit 61597b4

Browse files
committed
Cache handler update.
Changelog excerpt: - Added support for specifying a Redis database number to the supplementary cache options.
1 parent 6d63c78 commit 61597b4

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

Changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,4 +142,4 @@ __*Why "v3.0.0" instead of "v1.0.0?"*__ Prior to phpMussel v3, the "phpMussel Co
142142

143143
### v3.5.0
144144

145-
[2023.12.01; Maikuolan]: Improve escaping.
145+
[2023.12.01; Maikuolan]: Improved escaping. Added support for specifying a Redis database number to the supplementary cache options.

assets/config.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# License: GNU/GPLv2
88
# @see LICENSE.txt
99
#
10-
# This file: Configuration defaults file (last modified: 2023.10.12).
10+
# This file: Configuration defaults file (last modified: 2023.12.01).
1111
##/
1212

1313
core:
@@ -482,6 +482,11 @@ supplementary_cache_options:
482482
type: "float"
483483
step: "any"
484484
default: 2.5
485+
redis_database_number:
486+
type: "int"
487+
default: 0
488+
min: 0
489+
max: 9999
485490
pdo_dsn:
486491
type: "string"
487492
default: "mysql:dbname=phpmussel;host=localhost;port=3306"

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"require": {
1414
"php": ">=7.2.0",
15-
"maikuolan/common": "^2.11",
15+
"maikuolan/common": "^2.12",
1616
"ext-pcre": "*"
1717
},
1818
"suggest": {

src/Loader.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1274,12 +1274,13 @@ private function initialiseCache(): void
12741274
$this->Cache->RedisHost = $this->Configuration['supplementary_cache_options']['redis_host'];
12751275
$this->Cache->RedisPort = $this->Configuration['supplementary_cache_options']['redis_port'];
12761276
$this->Cache->RedisTimeout = $this->Configuration['supplementary_cache_options']['redis_timeout'];
1277+
$this->Cache->RedisDatabaseNumber = $this->Configuration['supplementary_cache_options']['redis_database_number'];
12771278
$this->Cache->PDOdsn = $this->Configuration['supplementary_cache_options']['pdo_dsn'];
12781279
$this->Cache->PDOusername = $this->Configuration['supplementary_cache_options']['pdo_username'];
12791280
$this->Cache->PDOpassword = $this->Configuration['supplementary_cache_options']['pdo_password'];
12801281

12811282
/** Assign cache path. */
1282-
if ($this->CachePath) {
1283+
if ($this->CachePath !== '') {
12831284
$this->Cache->FFDefault = $this->CachePath . DIRECTORY_SEPARATOR . 'cache.dat';
12841285
}
12851286

0 commit comments

Comments
 (0)