Skip to content

Require PHP 5.5+#2495

Merged
Alkarex merged 4 commits intoFreshRSS:devfrom
Alkarex:require_php5.5
Aug 20, 2019
Merged

Require PHP 5.5+#2495
Alkarex merged 4 commits intoFreshRSS:devfrom
Alkarex:require_php5.5

Conversation

@Alkarex
Copy link
Copy Markdown
Member

@Alkarex Alkarex commented Aug 17, 2019

#2469 (comment)
I think it would be reasonable to require PHP 5.5+ for the core of FreshRSS after all.

As Frenzie said, WordPress currently requires PHP 5.6.20+, and it is the most popular PHP application.

We would loose about 20% of the PHP servers according to https://w3techs.com/technologies/details/pl-php/5/all but I expect this number to drop fast after the release of CentOS 8 (CentOS accounts for 17% of Linux servers https://w3techs.com/technologies/details/os-linux/all/all ).

Distributions:

  • no impact on Ubuntu, Fedora, Alpine, OpenWRT, FreeBSD, OpenSuze, Mageia, as all active versions have PHP ≥ 7
  • no impact on Synology, as all active versions have PHP ≥ 5.6
  • we drop Debian 8 Jessie (-2020) - we keep supporting Debian 9 Stretch (2017-06) - current is Debian 10 Buster
  • we drop Red Hat 7 (-2024) - we keep supporting RHEL 8 (2019-05)
  • we drop CentOS 7 (-2024) - we will support CentOS 8 (to be released soonish)

When dropping older versions, I can better like when it is for a good reason, and there is actually one with PHP 5.5, namely generators (yield) https://php.net/language.generators.overview which I consider
using.

FreshRSS#2469 (comment)
I think it would be reasonable to require PHP 5.5+ for the core of
FreshRSS after all.

As Frenzie said, WordPress currently requires PHP 5.6.20+, and it is the
most popular PHP application.

We would loose about 20% of the PHP servers according to
https://w3techs.com/technologies/details/pl-php/5/all but I expect this
number to drop fast after the release of CentOS 8 (CentOS accounts for
17% of Linux servers
https://w3techs.com/technologies/details/os-linux/all/all ).

Distributions:
* no impact on Ubuntu, Fedora, Alpine, OpenWRT, FreeBSD, OpenSuze,
Mageia, as all active versions have PHP > 7
* no impact on OpenSuze, Synology, as all active versions have PHP > 5.5
* we drop Debian 8 Jessie (-2020) - we keep supporting Debian 9 Stretch
(2017-06) - current is Debian 10 Buster
* we drop Red Hat 7 (-2024) - we keep supporting RHEL 8 (2019-05)
* we drop CentOS 7 (-2024) - we will support CentOS 8 (to be released
soonish)

When dropping older versions, I can better like when it is for a good
reason, and there is actually one with PHP 5.5, namely generators
(yield) https://php.net/language.generators.overview which I consider
using.
@Alkarex Alkarex added this to the 1.15.0 milestone Aug 17, 2019
@Alkarex
Copy link
Copy Markdown
Member Author

Alkarex commented Aug 17, 2019

Co-Authored-By: Frans de Jonge <[email protected]>
Alkarex added a commit to Alkarex/FreshRSS that referenced this pull request Aug 18, 2019
@Alkarex
Copy link
Copy Markdown
Member Author

Alkarex commented Aug 19, 2019

Actually, moving to PHP 5.6+ would not be much harder than 5.5+ based on the statistics and versions available in the distributions (which have either a version <= 5.4 or >= 5.6).
I could not find any big distribution on DistroWatch that is maintaining a PHP 5.5, e.g. https://distrowatch.com/table.php?distribution=Debian

@Frenzie
Copy link
Copy Markdown
Member

Frenzie commented Aug 19, 2019

No real objections here. Anything specific though?

https://www.php.net/manual/en/migration56.new-features.php

A few of those sound somewhat interesting (e.g., variadic functions) but at the same time a minor syntactic convenience isn't much of a reason.

@Alkarex
Copy link
Copy Markdown
Member Author

Alkarex commented Aug 19, 2019

Ok. So let's stick to 5.5 now with a note that if we need 5.6 for anything, we can update without delay.

@marienfressinaud
Copy link
Copy Markdown
Member

I'm ok with this decision too 👍

I don't know how relevant the stats from w3techs.com are for our users, it may be interesting to do a survey to ask users where and how they host their instance of FreshRSS. Or even to add an option in FRSS (disabled by default) to send anonymous information automatically (but it's more work and I don't have time to work on this for the moment)

@Alkarex Alkarex mentioned this pull request Aug 20, 2019
@Alkarex Alkarex merged commit fd33d92 into FreshRSS:dev Aug 20, 2019
@Alkarex Alkarex deleted the require_php5.5 branch August 20, 2019 12:55
marienfressinaud pushed a commit to flusio/FreshRSS that referenced this pull request Sep 13, 2019
marienfressinaud pushed a commit to flusio/FreshRSS that referenced this pull request Sep 15, 2019
marienfressinaud pushed a commit to flusio/FreshRSS that referenced this pull request Sep 15, 2019
Alkarex added a commit that referenced this pull request Sep 15, 2019
* CLI to export/import any database to/from SQLite

Require PHP 5.5+ #2495

* Travis

* Execution rights

* Fix wrong static fields

* Fix MySQL bad default buffering

https://stackoverflow.com/questions/6895098/pdo-mysql-memory-consumption-with-large-result-set/6935271#6935271
https://php.net/manual/ref.pdo-mysql

* Fix count on progression

* Avoid static DB information

To ease working with two DBs at the same time

* Less static, simplify

Needs some testing

* Small corrections

* Special case for SQLite to SQLite

* Modify special case for SQLite

* Remove special case for SQLite

More uniform logic for the 3 databases.
Fix wrong DROP TABLE for SQLite.

* Drop indexes

* Revert "Drop indexes"

This reverts commit f28d2ba.

* Fix deletion

* Fix classic export

* Update cli/README.md

Co-Authored-By: Marien Fressinaud <[email protected]>

* Addressing part of review

* Remove goto 😢

* Travis

* Comment for SQLite case

* Fix missing fields when inserting
@Alkarex
Copy link
Copy Markdown
Member Author

Alkarex commented Sep 16, 2019

Actually, I am refactoring a bit our PDO code (#2522 ) and I do have a wish to move to PHP 5.6+ to be able to use constant arrays
https://www.php.net/manual/en/migration56.new-features.php

Instead of the current global approach, which is not so nice, e.g.:

global $SQL_CREATE_TABLES, $SQL_CREATE_TABLE_ENTRYTMP, $SQL_CREATE_TABLE_TAGS;
if (is_array($SQL_CREATE_TABLES)) {

global $SQL_CREATE_TABLES;
$SQL_CREATE_TABLES = array(
'CREATE TABLE IF NOT EXISTS "%1$scategory" (
"id" SERIAL PRIMARY KEY,
"name" VARCHAR(255) UNIQUE NOT NULL
);',

What do you think? Is it worth it?

@Frenzie
Copy link
Copy Markdown
Member

Frenzie commented Sep 16, 2019

It's a real feature, so I don't see why not. 👍

@marienfressinaud
Copy link
Copy Markdown
Member

It would be a nice simplification :) and #2495 (comment) was already a sufficient reason to move on

@Alkarex
Copy link
Copy Markdown
Member Author

Alkarex commented Sep 17, 2019

CentOS 8 will be released next week with PHP 7.2 https://wiki.centos.org/About/Building_8

Alkarex added a commit to Alkarex/FreshRSS that referenced this pull request Sep 17, 2019
@Alkarex Alkarex mentioned this pull request Sep 17, 2019
Alkarex added a commit to Alkarex/FreshRSS that referenced this pull request Oct 5, 2019
@Alkarex Alkarex mentioned this pull request Oct 5, 2019
Alkarex added a commit that referenced this pull request Oct 5, 2019
Alkarex added a commit to Alkarex/FreshRSS that referenced this pull request Oct 22, 2019
https://php.net/migration54.new-features thanks to
FreshRSS#2495

Use `<?=  ?>` instead of `<?php echo; ?>`
10kB of code saved :-)

Done with regular expression:
```
<\?php echo (.+?);? *\?>
<?= \1 ?>
```
Alkarex added a commit that referenced this pull request Oct 23, 2019
* Take advantage of PHP 5.4+ short echo

https://php.net/migration54.new-features thanks to
#2495

Use `<?=  ?>` instead of `<?php echo; ?>`
10kB of code saved :-)

Done with regular expression:
```
<\?php echo (.+?);? *\?>
<?= \1 ?>
```

* Try Travis fix

squizlabs/PHP_CodeSniffer#2045 (comment)
This was referenced Oct 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants