Skip to content

Move PHP minimum version check#7560

Merged
Alkarex merged 1 commit intoFreshRSS:edgefrom
Alkarex:php-version-check
May 7, 2025
Merged

Move PHP minimum version check#7560
Alkarex merged 1 commit intoFreshRSS:edgefrom
Alkarex:php-version-check

Conversation

@Alkarex
Copy link
Member

@Alkarex Alkarex commented May 7, 2025

It is too late to check for minimum version check in lib_rss.php because that file already contains some relatively new PHP language constructs, which will lead to a syntax error - when running with an old PHP version - instead of the expected error message.
Moved to constants.php for now.

Example of syntax error with PHP 7.4:

PHP Parse error:  syntax error, unexpected '|', expecting '{' in /var/www/FreshRSS/lib/lib_rss.php on line 166

Should help users like in:

It is too late to check for minimum version check in `lib_rss.php` because that file already contains some relatively new PHP language constructs, which will lead to a syntax error - when running with an old PHP version - instead of the expected error message.
Moved to `constants.php` for now.

Example of syntax error with PHP 7.4:
```
PHP Parse error:  syntax error, unexpected '|', expecting '{' in /var/www/FreshRSS/lib/lib_rss.php on line 166
```

Should help users like in:
* FreshRSS#7539
* FreshRSS#7557
@Alkarex Alkarex added the php Pull requests that update Php code label May 7, 2025
@Alkarex Alkarex added this to the 1.27.0 milestone May 7, 2025
Copy link
Member

@Frenzie Frenzie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, that'll make such error messages more helpful. :-)

@Alkarex Alkarex merged commit 3f18739 into FreshRSS:edge May 7, 2025
1 check passed
@Alkarex Alkarex linked an issue May 7, 2025 that may be closed by this pull request
@Alkarex Alkarex modified the milestones: 1.27.0, 1.26.3 May 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

php Pull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] v1.26.2: Parse error ehen running actualize_script.php

2 participants