edwardspec / mediawiki-aws-s3

Extension:AWS allows MediaWiki to use Amazon S3 (instead of the local directory) to store images.
https://www.mediawiki.org/wiki/Extension:AWS
GNU General Public License v2.0
42 stars 32 forks source link

Question: Is AWS extension ready to PHP 8.1? #56

Closed MPThLee closed 1 year ago

MPThLee commented 1 year ago

As of mediawiki 1.39, both version of PHP 8.0 and 8.1 are supported now.

But according to PHP.watch, there’s lots of deprecation and change that need to change codes.

I think these issue will be affected to AWS extension. (Didn’t tested as my wiki uses SemanticMediawiki that gives up during update.php phase on php 8.1…)

https://php.watch/versions/8.1/internal-func-non-nullable-null-deprecation

passing null to a function/method parameter that is not declared nullable is not allowed

https://php.watch/versions/8.1/internal-method-return-types

lack of a return type declaration is also considered a return type mismatch.

I just searched code a minute and there’s lots of no-return-type functions, which may causing deprecation log spam.

Note: I'm running PHP 8.0 on my wiki seems there's no issue with AWS.

P.S: PHP 7.4 is now EOL so CI must ran on at least 8.0 I think? As today, security update of MW 1.35 and 1.38 contains fix of PHP8 compatibility issue.

edwardspec commented 1 year ago

I added PHP 8.0 and PHP 8.1 to CI runs.

lack of a return type declaration is also considered a return type mismatch.

Iterator classes were affected by this deprecation, so I fixed that.

passing null to a function/method parameter that is not declared nullable is not allowed

This doesn't seem to be happening anywhere. If you see a specific part of the code that you believe has this issue, please point at it.

After the iterators were updated, the testsuite succeeds with MediaWiki 1.39 + PHP 8.1. Updated code still works with PHP 7.3 (the lowest PHP version supported by MediaWiki 1.35, which we still support).

MPThLee commented 1 year ago

I mentioned passing null to a function/method parameter that is not declared nullable is not allowed because it's common case. I just saw some of code within a minute for simple review and it seems like it does log spam on php8.1 so I posted this issue. Also, just a note; Some of WMF(gerrit) extension has that issue so mentioned just in case. Which sometime did deprecate log spam to our wiki.

Anyways, Thank you!