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

PHP 8.1 compatibility (without IntlDateFormatter) #713

Merged
merged 4 commits into from
Jan 21, 2022
Merged

PHP 8.1 compatibility (without IntlDateFormatter) #713

merged 4 commits into from
Jan 21, 2022

Conversation

thirsch
Copy link
Contributor

@thirsch thirsch commented Jan 18, 2022

This is the follow-up for #711. I tried to keep as many commits without modification here. Hope that's ok @got

I coudn't find a way to update the previous pr, sorry.

@thirsch thirsch mentioned this pull request Jan 18, 2022
clearstatcache(true, $cached->lock_id);
if (is_file($cached->lock_id)) {
clearstatcache(true, $cached->lock_id ?? '');
if (null !== $cached->lock_id && is_file($cached->lock_id)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since you closed previous one, carry the discussion:

Copy link
Contributor Author

@thirsch thirsch Jan 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we continue the discussion here? My last answer was:

Personally I agree with your point, but IMO it's out of scope of this change. What the original author tried to do is "doing whatever php < 8.1 would do". So another pr should cope with the issue.

But we can also remove the change in line #199 as it's only a deprecation warning in php 8.1

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no say of this, as I'm not the maintainer.

personally, I would carry the fix to separate PR and hope it gets merged sooner as the change is smaller.

ps: edit #199 to be backticks as it links to bogus ticket, or replace with link to source

thirsch and others added 4 commits January 18, 2022 15:56
Co-Authored-By: Thomas BACCELLI <tbaccelli@gmail.com>
Co-Authored-By: Thomas BACCELLI <tbaccelli@gmail.com>
@thirsch thirsch changed the title PHP 8.1 compatibility (again) PHP 8.1 compatibility (without IntlDateFormatter) Jan 20, 2022
@trasher
Copy link

trasher commented Jan 21, 2022

Hi,
There are still strftime calls that will make Smarty fail with PHP 8.1:

libs/plugins/function.html_select_date.php:                ($month_format === '%m' ? $_val : strftime($month_format, $_month_timestamps[ $i ]));
libs/plugins/function.html_select_date.php:            $_value = $month_value_format === '%m' ? $_val : strftime($month_value_format, $_month_timestamps[ $i ]);
libs/plugins/modifier.date_format.php:        return strftime($format, $timestamp);

Can a maintainer approve the actions workflow run so we can also see tests results? Thanks!

@thirsch
Copy link
Contributor Author

thirsch commented Jan 21, 2022

Hi, There are still strftime calls that will make Smarty fail with PHP 8.1 [...]

yes, please see the discussion in #678. This pr is just a follow-up without fixing the strftime issues. These are deprecations only and the main goal is to get smarty running under 8.1.

@trasher
Copy link

trasher commented Jan 21, 2022

Yes, I've realized. Thanks.

@wisskid wisskid merged commit 0ef0dda into smarty-php:master Jan 21, 2022
@thirsch thirsch deleted the php81 branch January 21, 2022 11:14
@iwiznia
Copy link

iwiznia commented Jan 21, 2022

Nice, thanks @thirsch!!
@wisskid is there going to be a new version release to include these changes?

@thirsch
Copy link
Contributor Author

thirsch commented Jan 21, 2022

Kudos clearly must go to @atomiix!

Copy link

@acun87 acun87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

id_ed25519.pub

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.

7 participants