INFO declares compat = 1.2.20, and Cacti 1.2.x supports PHP 7.4. Two files on
develop use PHP 8.0 syntax, so installing on such a server fails at parse time
rather than reporting a version mismatch.
Linting the tree on a pinned php:7.4-cli container:
Parse error: syntax error, unexpected '|', expecting variable in ./phpstan/stubs/cacti.stubs.php on line 94
Parse error: syntax error, unexpected '|', expecting '{' in ./audit_syslog.php on line 623
audit_syslog.php:623:
function audit_syslog_fwrite(mixed $socket, string $message, string &$warning = ''): int|false {
mixed and int|false are both 8.0+. The stub file is dev-only and not loaded at
runtime, so audit_syslog.php is the one that matters.
These arrived with #63. tests/Security/Php74CompatibilityTest.php was removed in the
same change and replaced by tests/Security/Php81SyntaxTest.php, which states the
plugin targets 8.1+. The CI matrix runs 8.1 through 8.4, so nothing exercises the
floor that INFO advertises.
Two ways to close the gap, depending on which is intended:
- If 8.0+ is the intended floor, raise
compat to a Cacti release whose PHP floor
matches, note the requirement in README.md, and add a PHP_VERSION_ID guard in
setup.php so an old server gets a message instead of a fatal.
- If 1.2.20 support is still wanted, restore 7.4-compatible signatures in
audit_syslog.php and add a lint job on 7.4 to keep it that way.
Happy to send a PR for either once you pick.
INFOdeclarescompat = 1.2.20, and Cacti 1.2.x supports PHP 7.4. Two files ondevelopuse PHP 8.0 syntax, so installing on such a server fails at parse timerather than reporting a version mismatch.
Linting the tree on a pinned
php:7.4-clicontainer:audit_syslog.php:623:mixedandint|falseare both 8.0+. The stub file is dev-only and not loaded atruntime, so
audit_syslog.phpis the one that matters.These arrived with #63.
tests/Security/Php74CompatibilityTest.phpwas removed in thesame change and replaced by
tests/Security/Php81SyntaxTest.php, which states theplugin targets 8.1+. The CI matrix runs 8.1 through 8.4, so nothing exercises the
floor that
INFOadvertises.Two ways to close the gap, depending on which is intended:
compatto a Cacti release whose PHP floormatches, note the requirement in
README.md, and add aPHP_VERSION_IDguard insetup.phpso an old server gets a message instead of a fatal.audit_syslog.phpand add a lint job on 7.4 to keep it that way.Happy to send a PR for either once you pick.