Freshrss: Support PHP 8

Created on 26 Jun 2020  路  22Comments  路  Source: FreshRSS/FreshRSS

https://github.com/php/php-src/blob/php-8.0.0alpha1/UPGRADING

In particular:

  • [x] Removed create_function(). Anonymous functions may be used instead. (Used by lib_phpQuery.php)
Important help wanted

Most helpful comment

All working here. No errors or warnings in the logs and all feeds fetched okay.

All 22 comments

Would that mean upping the requirements to 5.4? (Not an objection, just a question.)

We are already at PHP 5.6+ 馃

Oh right, I forgot about that. :facepalm:

The website does not reflect that. We should update it.

Ah! I'm not crazy. The website says "older PHP versions*: 5.6+, 5.5+, 5.4+ or 5.3.3+"

I could've sworn I'd seen that somewhere quite recently, and I had! :-D

I tend to forget about the Web site... The Readmes and the docs are up to date.
Anyone for a PR? 馃槈

Hi, I'd like to work on this update.

@prashant-tholia You are very welcome 馃憤 I suggest you start by excluding lib_phpQuery.php (library use for fetching full text content, and which we might replace by something else) and potentially come back to it when the rest is working

@Alkarex Thanks. I'll start by excluding lib_phpQuery.php as you suggest.

Excellent. Remember to enable 'environment' => 'development', in your ./FreshRSS/data/config.php to get additional logs / warnings.

Sure, I'll do so.

Hi @Alkarex, I sincerely apologize for reverting back so late.

I have started with updating lib_phpQuery.php to replace create_function calls in the file with anonymous functions and have committed the update in the commit mentioned just above.

I was not entirely sure about what you meant by "excluding lib_phpQuery.php". I assumed it to be what is included in this update and implemented it. If I am not correct, I request you to let me know what exactly was needed to be done.

Thanks.

@Alkarex probably meant that you can comment out the HTML sanitization so you can focus on the incompatibilities in the actual program rather than this particular library.

https://github.com/FreshRSS/FreshRSS/blob/be5f9f2dceba7b67041295914169fcbbbb07e5fd/app/Models/Entry.php#L398-L418

@Frenzie, I'm sorry for interpreting incorrectly. Thanks for the clarification.

One query - After commenting out the code mentioned in your post, shall I start implementing updates for items mentioned at https://github.com/php/php-src/blob/php-8.0.0alpha1/UPGRADING, starting from the top?

If you already took care of the library it hardly matters of course! ;-) It's just of lesser relevance from our perspective; we might fix it up or we might replace it with a different method.

Indeed, it is great if you have looked at lib_phpQuery.php @prashanttholia and thanks for that, but the most important is to get the non-library parts of FreshRSS (i.e. the core) to be compatible.
On a related topic, I will take care of merging the SimplePie updates for PHP 8.0 after the release of FreshRSS 1.17.0.

Hi, I have created separate pull request for this issue. I'll keep updating the pull request with update commits as I progress.

I am going ahead by starting with PHP 8 changes listed at the top of the page - https://github.com/php/php-src/blob/php-8.0.0alpha1/UPGRADING

Where is this up to?

PHP 8 has been released, as has Wordpress 5.6, one of the biggest projects that supports it (driving server updates).

We might want to release PHP 8 support as a point update (or defer other issues to a later milestone and release 1.18.0).

@drewkerr It should work, but has not been much tested yet

@Alkarex Okay, I can test with PHP 8 and report back.

All working here. No errors or warnings in the logs and all feeds fetched okay.

Here is a Dockerfile to test with PHP8 (requires manual docker build) https://github.com/FreshRSS/FreshRSS/pull/3294

Was this page helpful?
0 / 5 - 0 ratings