Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase minimum requirement to PHP 5.6 #331

Merged
merged 1 commit into from Sep 3, 2022

Conversation

TimWolla
Copy link
Contributor

@TimWolla TimWolla commented Sep 2, 2022

This PR is intended to spark a discussion.

While creating the PHP 8.2 deprecation corrections I've found it very painful to work with the codebase, because it is just so different from anything I regularly work with. At a certain points will also become really painful to support such a broad range of versions, requiring to add workarounds for ancient PHP versions no one really uses in practice any longer.

I've opted to upgrade to PHP 5.6 as a conservative-ish suggestion:

  • 5.2 and 5.3 are technically supported based on composer.json. However they are not tested in CI, so who knows if they actually work.
  • 5.4 and 5.5 are no longer supported even by WordPress which itself is very conservative with increasing its PHP requirements.

Thus 5.6 it is, following WordPress' lead. Personally I'd prefer 7.0 if you are comfortable with it, as that allows one to completely disregard everything that happened before the PHP 7 major.

@bytestream
Copy link
Contributor

bytestream commented Sep 2, 2022

I'm not against increasing the version requirements.

However:

The library hasn't had any new features for a while, it's pretty much been in maintenance mode. I'm not sure there's adequate reason to bump the requirement.

At a certain points will also become really painful to support such a broad range of versions, requiring to add workarounds for ancient PHP versions no one really uses in practice any longer.

In my experience, most of the pain comes from other packages changing their dependencies. That argument hasn't come to fruition yet, mainly because the only external dependency we have is simpletest. That being said, now that we're pretty much having to maintain simpletest ourselves, at some point that's likely to become burdensome and increasingly difficult. There could be argument, at that time, to switch to something like PHPUnit which would then dictate the PHP requirements for HTMLPurifier...

@TimWolla
Copy link
Contributor Author

TimWolla commented Sep 2, 2022

The library hasn't had any new features for a while, it's pretty much been in maintenance mode. I'm not sure there's adequate reason to bump the requirement.

There's already some changes which effectively "increase" the requirements, e.g. this one: #326.

I'd also claim that maintenance is easier when you don't need to concern yourself with all the details of those older PHP versions. Do you know what changed between 5.2 and 5.3 from the top of your head? I certainly don't and even php.net does not have an upgrading guide for these versions. The oldest one is from 5.5 to 5.6.

I'm not saying that this increase in requirements should be used to make useless changes such as array() to [], but if a [] slips in when making a necessary change then it's a good thing if you don't need to point that out during review.

@ezyang
Copy link
Owner

ezyang commented Sep 3, 2022

If it's not in CI it doesn't exist. 5.6 sgtm.

@ezyang ezyang merged commit 1c2bae1 into ezyang:master Sep 3, 2022
ezyang added a commit that referenced this pull request Sep 18, 2022
* Add semantic release

* fix typo

* split from matrix

* remove only on push

* remove npm plugin

* write changelog to NEWS

* list assets to include in git commit

* fix update-for-release

* lint pr title

* split release into separate workflow that runs manually

* revert ci.yml changes

* remove references to WHATSNEW

* Fix #322 - PHP 8.1 deprecation notice in HostBlacklist URIFilter (#323)

* Replace 8.1-deprecated utf8_ funcs with mbstring (#326)

* Treat PHP version numbers as strings in GitHub Actions (#327)

YAML will try to interpret numeric values as numbers, leading to `8.0` being
interpreted as `8` instead of `'8.0'`.

This doesn't result in a functional change, but cleans up the output of the
jobs a little (e.g. in the title line).

* Update to `actions/checkout@v3` (#328)

This does not introduce any functional difference and is intended as a
future-proofing change.

see https://github.com/actions/checkout/releases/tag/v3.0.0

* Fix test selection logic in tests/test_files.php (#329)

Selecting the `fstools` tests also executed the `htmlt` tests.

* Fix some more PHP 8.2 deprecations (#330)

* Define HTMLPurifier_AttrTransform_SafeParam::$wmode

This fixes a PHP 8.2 deprecation.

* Define HTMLPurifier_DefinitionCache_DecoratorHarness::$cache

This fixes a PHP 8.2 deprecation.

* Define HTMLPurifier_DefinitionCache_DecoratorHarness::$mock

This fixes a PHP 8.2 deprecation.

* Define HTMLPurifier_DefinitionCache_DecoratorHarness::$def

This fixes a PHP 8.2 deprecation.

* Define HTMLPurifier_EntityParserTest::$_entity_lookup

This fixes a PHP 8.2 deprecation.

* Increase minimum requirement to PHP 5.6 (#331)

* Add contenteditable attribute definition (#332)

* Add contenteditable attribute definition

* gate behind html.trusted

* use enum

* Fix creation of dynamic property (#333)

* Fix creation of dynamic property (#337)

* Add PHP 8.2 to CI (#335)

* Add PHP 8.2 to CI

see #334

* Add PHP 8.2 to composer.json

* Fix contenteditable attribute definition (#336)

* Run CSSTidy tests on CI (#338)

* Run CSSTidy tests on CI

* update dirname

* use compopser instead of git clone

* use composer

* use test-settings.sample.php

* enable ext-intl

* disable Net_IDNA2

* Release 4.15.0

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
Co-authored-by: John Flatness <john@zerocrates.org>
Co-authored-by: Tim Düsterhus <duesterhus@woltlab.com>
Co-authored-by: Tim Düsterhus <timwolla@googlemail.com>
Co-authored-by: Edward Z. Yang <ezyang@mit.edu>
github-actions bot pushed a commit that referenced this pull request Sep 18, 2022
# [4.16.0](v4.15.0...v4.16.0) (2022-09-18)

### Features

* add semantic release ([#307](#307)) ([db31243](db31243)), closes [#322](#322) [#323](#323) [#326](#326) [#327](#327) [#328](#328) [#329](#329) [#330](#330) [#331](#331) [#332](#332) [#333](#333) [#337](#337) [#335](#335) [#334](#334) [#336](#336) [#338](#338)
@TimWolla TimWolla deleted the increase-requirements branch August 24, 2023 14:21
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.

None yet

3 participants