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

PHP8.4 deprecation notices fix attempt #1

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

NielBuys
Copy link
Owner

Attempt to Fix below issues
bcit-ci#6302
bcit-ci#6300
bcit-ci#6300

@NielBuys
Copy link
Owner Author

Changes not tested on php8.4 yet. But it should remove notices. Changes works on my php8.3 environment.

@jamieburchell
Copy link

jamieburchell commented Oct 8, 2024

Should probably bump the required PHP version to 7.1 if using nullable types. I personally don't care about anything < PHP 8.2, but I'm not sure if these PRs are supposed to be compatible with the PHP version mentioned in composer.json.

@jamieburchell
Copy link

jamieburchell commented Oct 8, 2024

Won't there still be deprecation notices in PHP 8.4 because session.sid_length is still being used?

@NielBuys
Copy link
Owner Author

NielBuys commented Oct 9, 2024

Should probably bump the required PHP version to 7.1 if using nullable types. I personally don't care about anything < PHP 8.2, but I'm not sure if these PRs are supposed to be compatible with the PHP version mentioned in composer.json.

On my fork I have bumped the minimum php version to 7.4. That's the reason I have not pushed this pull request to the main repository.

@NielBuys
Copy link
Owner Author

NielBuys commented Oct 9, 2024

Won't there still be deprecation notices in PHP 8.4 because session.sid_length is still being used?

Thanks for the heads up. I haven't tested my changes with PHP 8.4 yet; I've only researched and made the updates. I'll look into session.sid_length and set up a test environment for PHP 8.4.

@NielBuys
Copy link
Owner Author

NielBuys commented Oct 9, 2024

Won't there still be deprecation notices in PHP 8.4 because session.sid_length is still being used?

The session.sid_length section of the code was sourced from the pull request (codeigniter4/CodeIgniter4#9139) for CodeIgniter 4, which was referenced in issue bcit-ci#6300.

@jamieburchell
Copy link

The session.sid_length section of the code was sourced from the pull request (codeigniter4/CodeIgniter4#9139) for CodeIgniter 4, which was referenced in issue bcit-ci#6300.

Yup, that forces the params for <PHP9, but it will still trigger a deprecation error. CI4 gets around that in a different way

@jamieburchell
Copy link

jamieburchell commented Oct 9, 2024

At this point and assuming it stops the deprecation notice, I think I'd be tempted to simply prefix the ini_set call for session.sid_length and session.sid_bits_per_character with the error suppression character '@'.

@NielBuys
Copy link
Owner Author

NielBuys commented Oct 9, 2024

At this point and assuming it stops the deprecation notice, I think I'd be tempted to simply prefix the ini_set call for session.sid_length and session.sid_bits_per_character with the error suppression character '@'.

After reviewing it, I believe you're right; it will still trigger the deprecation notice. I think it’s a good idea to add the @ symbol in front of ini_set. I will make that change and then test to see if it works.

@jamieburchell
Copy link

@NielBuys I was feeling brave and decided to go all-out in my branch and remove code supporting < PHP 7.4. It might benefit you and your repo. Comments welcome too!

@NielBuys
Copy link
Owner Author

NielBuys commented Oct 9, 2024

@NielBuys I was feeling brave and decided to go all-out in my branch and remove code supporting < PHP 7.4. It might benefit you and your repo. Comments welcome too!

Thanks, I agree that it's a good idea to clean up some of the older PHP version code. I've created a patch file from your commit and will review it. I’ll let you know if I encounter any issues.

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.

2 participants