-
Notifications
You must be signed in to change notification settings - Fork 163
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
What should be the minimum PHP version for Cypht 3.0? PHP 8.1? 8.2? 8.3? #977
Comments
Related discussion: https://github.com/cypht-org/cypht/wiki/Lifecycle |
What is the state of php 8.x? |
I just officialized that Cypht 1.4.x is now an LTS version so end users don't have to rush to upgrade: |
Most (maybe all) active devs use PHP 8.x so they will fix any bugs they encounter. And we have seen such commits. A risk is that they don't also make sure to maintain support for PHP 7.4, which is one more reason to ditch 7.4. Since we now have Cypht LTS, users will have security patches for a while if they prefer waiting before proceeding to a major upgrade. |
That was true when I wrote it, but since then, we have improved https://github.com/cypht-org/cypht/wiki/Lifecycle so we'll only do a major revision if the code changes justify it. So now, a likely scenario is that master becomes 2.1.0 and then 2.2.0 and then 2.3.0. At this point, we'll probably be itching for bigger changes, so then master will become 3.0. |
I asked because I am specifically looking at some error handling, that I would presume breaks things: Should I bring this up in another discussion or is there a place for general php 8 discussions? |
Here is good. |
ok. Concerning this PDO error modes php.watch/versions/8.0/PDO-default-errmode. It appears php 7.x defaulted to make them silent, but 8.x is making them throw exceptions. This would have very different behaviors in the way cypht uses them since it is not explicitly setting a mode. So I recommend setting it explicitly. That being said, I agree with the decision to have it default to throw exceptions. I came upon this when trying to figure out why some database operations were not working while I was developing. cypht seems to capture and hide the actual errors as you can see here: cypht/scripts/create_account.php Lines 43 to 50 in 2cf7a0a
Unless there is another way to expose these errors (perhaps via a debug mode log) you cant see what the issue is, which is needed in order to fix it. In my testing I was able to turn the above into a single line: $auth->create($user, $pass); I explicitly ask for exceptions to happen when setting up the connection: self::$dbh[$key]->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); That way the (error) logs are actionable. |
A seperate issue I am running into that may be php 8 related, though I am not sure. The INSTALL file says to run when I do this I get:
My concern is the error. The warnings are also an issue, but I dont want to overload this conversation with that part. |
@Shadow243 Please advise |
@jonocodes, did you add some configurations? I am not able to reproduce this issue. The only scenario where this is possible is when we comment out:
from Nevertheless, I have some issues with php 7.4 and 8.0.
There is no error from 8.1 |
Adding When you say "we are scanning successfully the first time", what does that mean? What is doing the scanning? |
If we support PHP7.4 and PHP8 without proper error catching of PDO exceptions, I suggest we stay with explicit SILENT behavior as it used to be AND create a new PR for master/2.0.x (could be backported to 1.4 as well) where we turn on the exception error mode and add code to handle it correctly. |
as planed here: [https://avan.tech/item106800](PHPunit upgrade), we will either set 8.1 for phpunit 10 nor 8.2 for phpunit 11 |
Interesting: https://phpunit.de/supported-versions.html As of now, none of the Tiki versions require PHP 8.2+ (but some support it) Cypht running in Tiki is more important than PHPUnit 11. We could bump Tiki requirements to PHP 8.2 for Tiki 28 or Tiki29, but that is a community discussion. So as of now, I think the best is for Cypht to align with PHP requirements of Tiki. Tiki 27.x LTS requires PHP 8.1 so let's go to PHPUnit 10. |
Thank you @Shadow243 for #1044 |
I see #1044 already bumps requirement to PHP 8.1, closing this as done. |
I updated https://github.com/cypht-org/cypht/wiki/Lifecycle accordingly. |
PHP 8.x has already been stable for 3 years, and I've noticed many libraries now defaulting to a minimum version of PHP 8.x. PHP 7.x has already passed its EOL. While it would be a "nice" thing to continue to support PHP 7.x with Cypht, I think the best option is to keep Version 2.x around for that purpose and Version 3.x sets a minimum version of PHP 8.1. Just my take. |
We are not able to upgrade phpunit to 10 with php 7.4 bcz the minimum php version for phpunit 10 is 8.1 |
Yes, and that is what we are doing. Plus Cypht 1.4.x with support for PHP 5.6+. I added the supported PHP versions here: |
Cypht 1.3.x requires PHP 5.4
https://github.com/cypht-org/cypht/blob/release-1.3.0/composer.json
Cypht 1.4.x requires PHP 5.6
https://github.com/cypht-org/cypht/blob/1.4.x/composer.json#L31
As of now, Cypht master requires PHP 7.4
https://github.com/cypht-org/cypht/blob/master/composer.json#L39
Cypht master will branch to Cypht 2.0 soon.
So then master will be the future Cypht 3.0
Related: https://doc.tiki.org/PHP-8
The text was updated successfully, but these errors were encountered: