-
-
Notifications
You must be signed in to change notification settings - Fork 528
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: strftime() is deprecated #15864
Comments
I've been experimenting with this. Usage of IntlDateFormatter would be something along the lines of:
|
This issue has been mentioned on MODX Community. There might be relevant details there: https://community.modx.com/t/whats-happening-with-the-strftime-and-date-output-modifiers/4826/3 |
Two weeks ago I released a SiteDash update that tracks available PHP extensions to see if requiring intl would be feasible. On a sample size so far of about 18% of sites connected to SiteDash, roughly 81% of those have the intl extension enabled. That's more than imagick (75%) but less than fileinfo (91%). At those numbers I'd personally say we can conditionally use it in core; fallback to non-localised |
Sounds good to me! |
@Mark-H I'm proposing to make a start with this in 3.1. What do you think? |
Just keep in mind this is only a deprecation warning and will continue to work until PHP 9 is released. We also need to consider places where this will cause BC breaks and keep compatibility for those on PHP <= 8.x for the MODX 3.x branch. |
The
strftime()
function is called by the core in various places.In PHP 8.1 this will trigger a deprecation warning because the strftime() and gmstrftime() functions have been deprecated in favor of date()/DateTime::format() (for locale-independent formatting) or IntlDateFormatter::format() (for locale-dependent formatting).
References:
Environment
The text was updated successfully, but these errors were encountered: