Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 712dcfe

Browse files
committed
Post-EoL patch roundup.
1 parent a4151a8 commit 712dcfe

20 files changed

+447
-268
lines changed

.github/workflows/php-cs-fixer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
matrix:
1111
operating-system: [ubuntu-latest]
12-
php-versions: ['8.1']
12+
php-versions: ['8.3']
1313
name: PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }}
1414
steps:
1515
- name: Checkout

.github/workflows/v1.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
matrix:
1111
operating-system: [ubuntu-latest]
12-
php-versions: ['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
12+
php-versions: ['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
1313
name: PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }}
1414
steps:
1515
- name: Checkout

Changelog-v1.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ Detailed version release guidelines for phpMussel can be found at:
1212

1313
(none)
1414

15+
=== Version/Release 1.15.6 ===
16+
POST-EOL PATCH ROUNDUP.
17+
18+
Caleb M (Maikuolan),
19+
November 6, 2024.
20+
1521
=== Version/Release 1.15.5 ===
1622
PATCH RELEASE.
1723

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
[![v1: PHP >= 5.4](https://img.shields.io/badge/v1-PHP%20%3E%3D%205.4-8892bf.svg)](https://maikuolan.github.io/Compatibility-Charts/)
2-
[![v2~v3: PHP >= 7.2](https://img.shields.io/badge/v2%7Ev3-PHP%20%3E%3D%207.2-8892bf.svg)](https://maikuolan.github.io/Compatibility-Charts/)
1+
[![v1: PHP >= 5.4 < 8.4](https://img.shields.io/badge/v1-PHP%20%3E%3D%205.4%20%3C%208.4-8892bf.svg)](https://maikuolan.github.io/Compatibility-Charts/)
2+
[![v2: PHP >= 7.2 < 8.4](https://img.shields.io/badge/v2-PHP%20%3E%3D%207.2%20%3C%208.4-8892bf.svg)](https://maikuolan.github.io/Compatibility-Charts/)
3+
[![v3: PHP >= 7.2](https://img.shields.io/badge/v3-PHP%20%3E%3D%207.2-8892bf.svg)](https://maikuolan.github.io/Compatibility-Charts/)
34
[![License: GPL v2](https://img.shields.io/badge/License-GPL%20v2-blue.svg)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
45
[![PRs Welcome](https://img.shields.io/badge/PRs-Welcome-brightgreen.svg)](http://makeapullrequest.com)
56

@@ -40,8 +41,8 @@ An ideal solution for shared hosting environments, where it's often not possible
4041
- **[Русский](https://github.com/phpMussel/Docs/blob/master/readme.ru.md)**
4142
- **[اردو](https://github.com/phpMussel/Docs/blob/master/readme.ur.md)**
4243
- **[Tiếng Việt](https://github.com/phpMussel/Docs/blob/master/readme.vi.md)**
43-
- **[中文(简体)](https://github.com/phpMussel/Docs/blob/master/readme.zh.md)**
44-
- **[中文(傳統)](https://github.com/phpMussel/Docs/blob/master/readme.zh-tw.md)**
44+
- **[中文(简体)](https://github.com/phpMussel/Docs/blob/master/readme.zh-Hans.md)**
45+
- **[中文(傳統)](https://github.com/phpMussel/Docs/blob/master/readme.zh-Hant.md)**
4546

4647
#### See also:
4748
- [**phpMussel/phpMussel**](https://github.com/phpMussel/phpMussel) – The main phpMussel repository (you can get phpMussel versions prior to v3 from here).
@@ -57,4 +58,4 @@ An ideal solution for shared hosting environments, where it's often not possible
5758
---
5859

5960

60-
Last Updated: 1 March 2022 (2022.03.01).
61+
Last Updated: 1 July 2024 (2024.07.01).

vault/classes/ArchiveHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* License: GNU/GPLv2
99
* @see LICENSE.txt
1010
*
11-
* This file: Archive handler (last modified: 2021.10.30).
11+
* This file: Archive handler (last modified: 2024.11.06).
1212
*/
1313

1414
namespace phpMussel\ArchiveHandler;
@@ -133,7 +133,7 @@ public function __construct($Pointer)
133133
}
134134

135135
$this->ZipObject = new \ZipArchive();
136-
if (!$this->ZipObject->open($Pointer)) {
136+
if ($this->ZipObject->open($Pointer) !== true) {
137137
$this->ErrorState = 2;
138138
return;
139139
}

vault/classes/Maikuolan/Cache.php

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* A simple, unified cache handler (last modified: 2023.02.23).
3+
* A simple, unified cache handler (last modified: 2024.05.30).
44
*
55
* This file is a part of the "common classes package", utilised by a number of
66
* packages and projects, including CIDRAM and phpMussel.
@@ -62,6 +62,12 @@ class Cache
6262
*/
6363
public $RedisTimeout = 2.5;
6464

65+
/**
66+
* @var int Which database number Redis should select.
67+
* @link https://redis.io/commands/select/
68+
*/
69+
public $RedisDatabaseNumber = 0;
70+
6571
/**
6672
* @var string The DSN to use for PDO connections.
6773
*/
@@ -180,15 +186,15 @@ class Cache
180186
* be needed by some implementations to ensure compatibility).
181187
* @link https://github.com/Maikuolan/Common/tags
182188
*/
183-
const VERSION = '1.9.5';
189+
const VERSION = '1.11.0';
184190

185191
/**
186192
* Construct object and set working data if needed.
187193
*
188194
* @param array|null $WorkingData An optional array of default cache data.
189195
* @return void
190196
*/
191-
public function __construct(array $WorkingData = null)
197+
public function __construct($WorkingData = null)
192198
{
193199
if (is_array($WorkingData)) {
194200
$this->WorkingData = $WorkingData;
@@ -281,6 +287,12 @@ public function connect()
281287
$this->WorkingData = new \Redis();
282288
if ($this->WorkingData->connect($this->RedisHost, $this->RedisPort, $this->RedisTimeout)) {
283289
$this->Using = 'Redis';
290+
if ($this->RedisDatabaseNumber !== 0) {
291+
$this->WorkingData->select($this->RedisDatabaseNumber);
292+
if ($this->WorkingData->getDbNum() !== $this->RedisDatabaseNumber) {
293+
return false;
294+
}
295+
}
284296
return true;
285297
}
286298
$this->WorkingData = null;
@@ -347,13 +359,13 @@ public function connect()
347359
public function checkTablesPDO()
348360
{
349361
/** Try to determine which kind of query to build. */
350-
if (preg_match('~^sqlite\:[^\:]~i', $this->PDOdsn)) {
362+
if (preg_match('~^sqlite:[^:]~i', $this->PDOdsn)) {
351363
/** SQLite (excluding usage for in-memory and temporary tables). */
352364
$Check = 'SELECT count(*) FROM `sqlite_master` WHERE `type` = \'table\' AND `name` = \'Cache\'';
353-
} elseif (preg_match('~^informix\:~i', $this->PDOdsn)) {
365+
} elseif (preg_match('~^informix:~i', $this->PDOdsn)) {
354366
/** Informix. */
355367
$Check = 'SELECT count(*) FROM `systables` WHERE `tabname` = \'Cache\'';
356-
} elseif (preg_match('~^firebird\:~i', $this->PDOdsn)) {
368+
} elseif (preg_match('~^firebird:~i', $this->PDOdsn)) {
357369
/** Firebird/Interbase. */
358370
$Check = 'SELECT 1 FROM RDB$RELATIONS WHERE RDB$RELATION_NAME = \'Cache\'';
359371
} else {
@@ -637,13 +649,16 @@ public function incEntry($Key, $Value = 1, $TTL = 0)
637649
$Success = ($PDO->rowCount() > 0);
638650
}
639651
} elseif (is_array($this->WorkingData)) {
640-
if (
641-
isset($this->WorkingData[$Key]) &&
642-
is_array($this->WorkingData[$Key]) &&
643-
isset($this->WorkingData[$Key]['Data']) &&
644-
is_numeric($this->WorkingData[$Key]['Data'])
645-
) {
646-
$Value += $this->WorkingData[$Key]['Data'];
652+
if (isset($this->WorkingData[$Key])) {
653+
if (
654+
is_array($this->WorkingData[$Key]) &&
655+
isset($this->WorkingData[$Key]['Data']) &&
656+
is_numeric($this->WorkingData[$Key]['Data'])
657+
) {
658+
$Value += $this->WorkingData[$Key]['Data'];
659+
} elseif (is_numeric($this->WorkingData[$Key])) {
660+
$Value += $this->WorkingData[$Key];
661+
}
647662
}
648663
if ($TTL > 0) {
649664
$TTL += time();
@@ -699,13 +714,16 @@ public function decEntry($Key, $Value = 1, $TTL = 0)
699714
$Success = ($PDO->rowCount() > 0);
700715
}
701716
} elseif (is_array($this->WorkingData)) {
702-
if (
703-
isset($this->WorkingData[$Key]) &&
704-
is_array($this->WorkingData[$Key]) &&
705-
isset($this->WorkingData[$Key]['Data']) &&
706-
is_numeric($this->WorkingData[$Key]['Data'])
707-
) {
708-
$Value -= $this->WorkingData[$Key]['Data'];
717+
if (isset($this->WorkingData[$Key])) {
718+
if (
719+
is_array($this->WorkingData[$Key]) &&
720+
isset($this->WorkingData[$Key]['Data']) &&
721+
is_numeric($this->WorkingData[$Key]['Data'])
722+
) {
723+
$Value -= $this->WorkingData[$Key]['Data'];
724+
} elseif (is_numeric($this->WorkingData[$Key])) {
725+
$Value -= $this->WorkingData[$Key];
726+
}
709727
}
710728
if ($TTL > 0) {
711729
$TTL += time();
@@ -1066,7 +1084,7 @@ public function clearExpiredPDO()
10661084
*/
10671085
public function unserializeEntry($Entry)
10681086
{
1069-
if (!is_string($Entry) || !preg_match('~^a\:\d+\:\{.*\}$~', $Entry)) {
1087+
if (!is_string($Entry) || !preg_match('~^a:\d+:\{.*\}$~', $Entry)) {
10701088
return $Entry;
10711089
}
10721090
$Arr = unserialize($Entry);

vault/classes/Maikuolan/ComplexStringHandler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Complex string handler (last modified: 2023.02.23).
3+
* Complex string handler (last modified: 2024.05.30).
44
*
55
* This file is a part of the "common classes package", utilised by a number of
66
* packages and projects, including CIDRAM and phpMussel.
@@ -37,7 +37,7 @@ class ComplexStringHandler
3737
* be needed by some implementations to ensure compatibility).
3838
* @link https://github.com/Maikuolan/Common/tags
3939
*/
40-
const VERSION = '1.9.5';
40+
const VERSION = '1.11.0';
4141

4242
/**
4343
* Constructor.
@@ -47,7 +47,7 @@ class ComplexStringHandler
4747
* @param callable $Closure An optional closure to immediately call $this->iterateClosure.
4848
* @return void
4949
*/
50-
public function __construct($Data = '', $Pattern = '', callable $Closure = null)
50+
public function __construct($Data = '', $Pattern = '', $Closure = null)
5151
{
5252
if (!empty($Data) && is_string($Data)) {
5353
$this->Input = $Data;

vault/classes/Maikuolan/DelayedIO.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Delayed file IO class (last modified: 2023.02.23).
3+
* Delayed file IO class (last modified: 2023.12.29).
44
*
55
* This file is a part of the "common classes package", utilised by a number of
66
* packages and projects, including CIDRAM and phpMussel.
@@ -47,7 +47,7 @@ class DelayedIO
4747
* be needed by some implementations to ensure compatibility).
4848
* @link https://github.com/Maikuolan/Common/tags
4949
*/
50-
const VERSION = '1.9.5';
50+
const VERSION = '1.11.0';
5151

5252
/**
5353
* All pending modified files are written at object destruction.

vault/classes/Maikuolan/Demojibakefier.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Demojibakefier (last modified: 2023.02.23).
3+
* Demojibakefier (last modified: 2023.12.29).
44
*
55
* Intended to normalise the character encoding of a given string to a
66
* preferred character encoding when the given string's byte sequences don't
@@ -57,7 +57,7 @@ class Demojibakefier
5757
* be needed by some implementations to ensure compatibility).
5858
* @link https://github.com/Maikuolan/Common/tags
5959
*/
60-
const VERSION = '1.9.5';
60+
const VERSION = '1.11.0';
6161

6262
/**
6363
* Constructor.

vault/classes/Maikuolan/Events.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Events orchestrator (last modified: 2023.02.23).
3+
* Events orchestrator (last modified: 2023.12.29).
44
*
55
* This file is a part of the "common classes package", utilised by a number of
66
* packages and projects, including CIDRAM and phpMussel.
@@ -32,7 +32,7 @@ class Events
3232
* be needed by some implementations to ensure compatibility).
3333
* @link https://github.com/Maikuolan/Common/tags
3434
*/
35-
const VERSION = '1.9.5';
35+
const VERSION = '1.11.0';
3636

3737
/**
3838
* Adds a new event handler.
@@ -99,12 +99,14 @@ public function destroyEvent($Event)
9999
*/
100100
public function fireEvent($Event, $Data = '')
101101
{
102-
if (!isset($this->Handlers[$Event], $this->Status[$Event])) {
102+
if (!isset($this->Handlers[$Event], $this->Status[$Event]) || isset($this->Status[$Event]['In Progress'])) {
103103
return false;
104104
}
105+
$this->Status[$Event]['In Progress'] = true;
105106
foreach ($this->Handlers[$Event] as $Handler) {
106107
$Handler($Data);
107108
}
109+
unset($this->Status[$Event]['In Progress']);
108110
return true;
109111
}
110112

0 commit comments

Comments
 (0)