php-imagine / Imagine

PHP Object Oriented image manipulation library
https://imagine.readthedocs.io
Other
4.42k stars 529 forks source link

Drop php support below 5.6? #527

Closed burzum closed 3 years ago

burzum commented 7 years ago

Just see http://php.net/supported-versions.php

avalanche123 commented 7 years ago

👍

robfrawley commented 7 years ago

:+1:

romainneutron commented 7 years ago

What value does it bring to drop support? Let's think about the industry. PHP 5 is still widely used. Encouraging migrating to PHP7 does not mean dropping support of PHP5

As supporting old PHP versions is not a pain at the moment, and updating the dependency, I'm 👎 at the moment

burzum commented 7 years ago

@romainneutron php 5.6 is OK but already EOL. It will receive support until 18th December 2018. Nobody said to drop 5.6 yet. But I don't see a reason to stick to old, unsupported versions.

nicolas-grekas commented 7 years ago

:-1: also, unless you bump the major version number. Having this strict policy is one of the key success factor in Symfony - users know they can keep up to date within the same major version without being forced to change their infra. For sure it adds some burden on the maintainers yet it's really nice to users - and I think every maintainer should and wants to be nice to users, so the burden is worth it.

burzum commented 7 years ago

With all the upcoming changes just bump the version? Apply fixes that work for the 0.6.x version and make tests work and tag a new 0.6.x. After that bump to 0.7.0 or even 1.0.0 (if you want to go for semver) and drop php support for versions below 5.6.

romainneutron commented 7 years ago

Well @burzum ,

My point is that the industry (people working with PHP) are still using PHP 5 a lot. Ubuntu LTS still distribute PHP 5, Symfony LTS are still supporting PHP 5. For instance, CakePHP seems to support PHP 5.5 in its latest release too.

Imagine is a high quality library that helps its users, removing PHP 5 support will break imagine usage for lots of users. From the experience we have in Symfony, the backward compatibility promise is very important, and such changes should be considered very carefully.

I'd rather be in favor of working towards a Imagine 1.0.0 version and drop PHP 5.3 and 5.4 in a version 2, and wait for PHP 7 wide adoption to drop PHP 5 support in a version 3.

I don't understand your point, I don't understand why you don't want to support PHP 5 anymore. Please let me know.

robfrawley commented 7 years ago

PHP 5 has reached EOL ("end of life"), and that is reason enough for me. It is the responsibility of the community as a whole to help move people along to newer PHP versions and to avoid the slow move to PHP 5 and some of its minor releases. The slow adoption was facilitated by a lack of demand from users, due in part to a lack of higher requirements from the projects they used.

Additionally, the Packagist statistics show that every version of PHP is declining in usage except for PHP 7.x, which was 1% behind surpassing PHP 5.6's usage percentage back in November of 2015. [1] PHP 7.x is faster for users and offers a better experience for developers. Even PHP 5.6 would offer a great number of improvements and provide quite a few new language features.

A move from PHP 5.3 to 5.6 includes:

And a move all the way to PHP 7.x includes:

As for version naming, according to Semvar "Major version zero (0.y.z) is for initial development. Anything may change at any time. The public API should not be considered stable." [2] Additionally, the current release won't somehow disappear. We aren't considering the PHP version bump for the 0.6 series, but instead for our next major release. @nicolas-grekas Where did you get the idea we wouldn't bump the library version?

The 0.6 series will remain available (it's not like it'll be purged from Packagist) and of course, it will be maintained for some time with both bug fixes and security fixes; I'd highly recommend we continue to accept reasonable feature requests as well. The new code can (depending on demand) be backported to some extent, as well. But in the context of our next major release, I remain :+1: for a big PHP minimum version requirement bump. Some projects that use this library have already decided to do so in their next major release, including liip/imagine-bundle.

  1. https://seld.be/notes
  2. http://semver.org/
robfrawley commented 7 years ago

I do believe that we should treat this as a 1.0 release when we bump the PHP requirements, not a 0.7, regardless of the semvar recommendations.

romainneutron commented 7 years ago

@robfrawley IIUC, your point is to drop support of PHP 5 because it EOL'ed. I'm sorry, this is not enough, and you did not answer my arguments. I discussed yours, I would like a dialogue instead of being stucked in front of stubborn arguments.

Do you know Imagine's release history? There's not support for n and n - 1 branches, at the moment, there is only maintenance on the current branch. Maintaining a n - 1 branch for security and bug fix is huge work

burzum commented 7 years ago

I would like a dialogue instead of being stucked in front of stubborn arguments.

Calling other peoples arguments and concerns "stubborn" is not what I would call having a "dialog". It sounds arrogant the best and doesn't add value to the discussion.

I agree with @robfrawley and my suggestion would be to stabilise 0.6, get the tests working again, and fix the bugs that are reported. No new feature additions.

At the same time start working on a 1.0 branch that drops 5.6 support and goes directly to 7. It is not like that the 0.6 branch is unusable. It worked fine for years and even within the last ~2 years where almost no support at all was present. So I doubt anyone will complain if there is a 0.6 version that works for php5 and a modern version that gets new features.

While I agree that software development should be evolution and not revolution I don't see a revolution happen with this proposal because a working and usable solution for people stuck to older php versions will be still available. If "the industry" as you call it wants to stick to old versions fine, but then you have to live with some drawbacks, the same as when you decide to go for bleeding edge versions. I've worked on both kinds of projects before.

You can remove me as a collaborator from the repo by the way, looks like you guys have more time you can and want voluntary spend on it. It's enough for me that it looks like development is going on again now. :)

robfrawley commented 7 years ago

@romainneutron I simply expressed my opinion on the matter. Can we entertain the idea of being respectful of others?

garak commented 7 years ago

+1 for dropping support for 5.* and go for php7. We need an example from major libraries to take such steps. Of course, if someone is still on an old php version, they can continue using older versions of this library. Also, if there are major security issues, a new minor release for 0.6 can be released.

By the way: Ubuntu current LTS ships with php7

mlocati commented 6 years ago

-1 for dropping support for PHP versions at EOL. Not everybody can easily upgrade their projects. For instance, we have a server with PHP 5.5 running a huge project. It has been developed during 5 years by 6 people. Since it's so huge, even if it's full of tests, we can't cover all the possible cases. Furthermore, it's not exposed to the web (it in one of our LANs). So refreshing it's code it's not feasible (I already asked...).

garak commented 6 years ago

@mlocati just keep the old code. It will continue to work

mlocati commented 6 years ago

I still don't see why we should drop support to old PHP versions...

For instance, I'm looking forward for #585 getting merged: if Imagine drops support for old PHP versions, I'd have to manually apply patches to my installation. All that for no reason.

garak commented 6 years ago

Reason is to move along and exploit new features. We can't stay behind just because you're not able to update your code (but, ehi, you want issues to be closed, so you'll need to update something before of after...)

mlocati commented 6 years ago

Which are the features offered by newer PHP versions that are blocking furher development?

PS: furthermore, it seems to me that this package is somehow abandoned...

Koc commented 6 years ago

What about increase min php version before 1.0? People who still needed 5.x support can stay on 0.7.x without any troubles.

mlocati commented 6 years ago

Why? This library still works very well wih PHP 5.3...

Koc commented 6 years ago

For the furure and reasons explained by @robfrawley https://github.com/avalanche123/Imagine/issues/527#issuecomment-278841501

garak commented 6 years ago

Meanwhile, current Ubuntu LTS ships with php 7.2

mlocati commented 6 years ago

For the furure and reasons explained by @robfrawley #527 (comment)

I'm fully aware of the benefits of newer PHP versions. BTW Imagine doesn't use any of these features, so why should we drop support to it?

garak commented 6 years ago

So you can start to use them?

mlocati commented 6 years ago

So I should rewrite some code just to make it incompatible with old PHP versions?

Koc commented 6 years ago

I think than someone could open PR if you give green light to it merge.

mlocati commented 6 years ago

I'd prefer not to. I've spent a lot of time on this Imagine project because I need fixes for two projects: concrete5 (requiring PHP 5.5 at the moment) and a project of the company I work for (sadly using PHP 5.3 - I know, I know, ... but I really don't have the authorization to upgrade it - "it's absolutely out of question" they said me).

mlocati commented 6 years ago

And frankly I'm a bit surprised: the only contributions to this project have been "drop php 5.5- support" (many times), even if I put a lot of efforts in these recent pull requests, where a feedback would have been very welcome...

ninze commented 5 years ago

Whoever told @mlocati that upgrading PHP 5.3 is "absolutely out of question" might change their mind once they find out more and more libraries are moving to PHP7.

CoalaJoe commented 4 years ago

Would contribution be accepted to move the code base to PHP 7.2? (Current Security Fixes only)

mlocati commented 4 years ago

IMHO no. We have a lot of open issues, if you really want to contribute...

CoalaJoe commented 4 years ago

I see it this way:

Dropping support for unsupported PHP versions would:

Which in return would make it easier for people to contribute.

mlocati commented 4 years ago

I don't think that the reason why people don't contribute to this project is because they have to write array() instead of [] (or stuff like this).

jleckie commented 3 years ago

Just had to write a PR for this library, and having to remember how to write PHP like its 2010 is certainly not straight forward.

mdeboer commented 3 years ago

So just because people failed to upgrade to 7.x or 8.x and still use an EOL version is reason enough justification to hold back on the development of this library?

In fact that is the only argument given, contrary to the plenty of arguments given to do upgrade to 7.x.

I am willing to put in some effort to support the Vips library but only if PHP 5.6 support is dropped. Not going back there again.

mlocati commented 3 years ago

So just because people failed to upgrade to 7.x or 8.x and still use an EOL version is reason enough justification to hold back on the development of this library?

What's being hold back?

ausi commented 3 years ago

Looking at the contribution graph I think it’s clear that @mlocati is the maintainer of this library since 2018. If he needs PHP 5 support, we obviously keep it because we don’t want to loose our maintainer.

I am willing to put in some effort to support the Vips library but only if PHP 5.6 support is dropped. Not going back there again.

I like tabs over spaces, so I could have said that I will not put effort into pull requests until the library switches to tabs. But instead I actually created pull requests for features and bugfixes to improve the library.

Also, creating a Vips driver can be perfectly done in it’s own library (I did that for an SVG driver for example).

The library is PHP 8.0 compatible with version 1.2.4 (who made the pull request? 😉), nothing is hold back IMO.

So I’d suggest, instead of insisting to drop support for something, start contributing. There is enough work do be done, e.g. review the AVIF/HEIC pull request #759 test it and help me fix the CI issues for example.

ninze commented 3 years ago

I generally agree with @ausi and @mlocati that dropping PHP5 support wouldn't magically increase the number of contributions to this project. On the other hand, in order to get more contributors, this project probably needs more users. When I am searching for a library to use, I generally look for an active project with a good community and lots of active developers and modern features that make my coding more enjoyable. I would not pick a php3 or php4 library for my new project. Would I pick php5? Depends... But generally we don't want Imagine to look like old fashioned abandonware and at some point it will be time to let go.

ausi commented 3 years ago

My dream solution would be to create a new version 2.0 with support for PHP 7.4+ (or even 8.0+) and keep working on bugfixes (maybe even some features) for 1.x.

The 2.0 version could then also add support for newer php features like scalar types and more.

But maintaining two versions is a whole lot more work and I can fully understand if the maintainer does not want to go that route. This would most likely also mean more work for contributors having to take two versions into account (for bugfixes at least).

garak commented 3 years ago

But maintaining two versions is a whole lot more work

That's not true anymore, at least since tools like Rector exist.

mdeboer commented 3 years ago

My dream solution would be to create a new version 2.0 with support for PHP 7.4+ (or even 8.0+) and keep working on bugfixes (maybe even some features) for 1.x.

The 2.0 version could then also add support for newer php features like scalar types and more.

But maintaining two versions is a whole lot more work and I can fully understand if the maintainer does not want to go that route. This would most likely also mean more work for contributors having to take two versions into account (for bugfixes at least).

Depends where you draw the line. If you start version 2.0 then you could say 1.x will only receive bug fixes and no new features. Then you're free to fundamentally change 2.0 while people requiring and maintaining the 1.x version can still do so. For all I care they can even propose new features as long as they are ported upstream to 2.0 or 2.0 provides a similar feature.

Tons of projects have moved on, sure this project can do too.

mbabker commented 3 years ago

How about using analytical data to justify maintenance burdens? Composer has a fancy feature showing PHP versions used to install a package, so let's take a look at https://packagist.org/packages/imagine/imagine/php-stats.

PHP 5 accounts for, at best, 3% of all installs of this package since the PHP version stats went live. If you filter that down to only 1.2 (current minor version branch) installs, the number is basically zero. If you look at PHP 7.0 and 7.1 users, they still account for maybe 8% of total installs, but the vast majority of those are 0.x installs.

So, there is a lot of argument being made to keep support for EOL PHP versions because someone might need to be able to use the current library features on old PHP versions, but statistically, that user base just does not exist. The overwhelming majority of library users are on PHP 7.2 and later. So why justify the maintenance requirement for older PHP versions?

ausi commented 3 years ago

If you filter that down to only 1.2 (current minor version branch) installs, the number is basically zero.

I get around 0.4% for PHP 5 from the stats. With 19,500 installs per day thats about 78 daily installs on PHP 5.

but statistically, that user base just does not exist.

From my reading of the statistics the library gets installed around 28,470 times on PHP 5 in one year.

garak commented 3 years ago

From my reading of the statistics the library gets installed around 28,470 times on PHP 5 in one year.

What's the point? Dropping support for old versions will not prevent such people from do the same installation another million times

mlocati commented 3 years ago

Which issue will be fixed if we drop support for old php versions?

ninze commented 3 years ago

Which issue will be fixed if we drop support for old php versions?

This very same argument might still be valid in 2030 :)

mlocati commented 3 years ago

This very same argument might still be valid in 2030 :)

I'd ask the very same question even in 2050

garak commented 3 years ago

Which issue will be fixed if we drop support for old php versions?

this very one

mbabker commented 3 years ago

Which issue will be fixed if we drop support for old php versions?

If you are looking for a specific bug report which can only be fixed by dropping legacy PHP support, then my guess is that this is the only one, and either this is an actionable request or should be closed out as a "won't fix" item.

What dropping legacy PHP support does fix, which cannot be measured in a GitHub issue report, is:

mlocati commented 3 years ago

@mbabker so, since I'm the de facto maintainer, that's only a problem for me, isn't it?