Review main Merged

72055[BUGFIX] Suppress E_DEPRECATED for strftime() and gmstrftime()

Stefan Bürk CR +2 V +2 Easy +29 −15 updated 11/05/21, 09:34

Commit message

PHP functions strftime() and gmstrftime() have been deprecated in
PHP 8.1 and will be removed in PHP 9.0. Currently, there is no way
to replace this seamlessly as no drop-in replacement is available.

Official PHP 8.1 deprecation RFC:
https://wiki.php.net/rfc/deprecations_php_8_1#strftime_and_gmstrftime

strftime() has been used in several places in the core, and even
concrete wrapper like TypoScript 'stdWrap_strftime' or support in
fluid viewhelper 'f:date'. Besides this, some places used it to
format date or locale datetimes, which may be replaceable.

As we cannot provide drop-in replacement which would be breaking,
or adding a hard requirement of the optional php extension intl,
this patch suppresses deprecation warnings on calls of strftime()
and gmstrftime(), using the '@' error control operator.

Further, corresponding @todo's are added along the way to replace
the occurrences in v12.

Review

  • Code review CR +2 Done
    • Andreas Kienast +2
    • Nikita Hovratov +1
  • Verified V +2 Done
    • Andreas Kienast +2
    • Nikita Hovratov +1
    • core-ci +1 CI

Issues 2

Files 9

Review log 914

  1. Stefan Bürk uploaded patch set 1 11/04/21, 17:58

  2. core-ci voted on patch set 1 V +1 11/04/21, 18:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/18916

  3. Nikita Hovratov updated the commit message in patch set 2 11/04/21, 20:43

  4. Nikita Hovratov voted on patch set 2 V +1 CR +1 11/04/21, 20:45

  5. core-ci voted on patch set 2 V +1 11/04/21, 21:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/18918

  6. Stefan Bürk updated the commit message in patch set 3 11/04/21, 22:33

  7. core-ci voted on patch set 3 V -1 11/04/21, 22:49 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/18919

  8. core-ci voted on patch set 3 V +1 11/04/21, 22:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/18919

  9. Georg Ringer commented on patch set 3 11/05/21, 07:22

    could we add a link in the commit message to the official deprecation?
  10. Nikita Hovratov updated the commit message in patch set 4 11/05/21, 07:30

  11. Nikita Hovratov voted on patch set 4 V +1 CR +1 11/05/21, 07:31

  12. core-ci voted on patch set 4 V +1 11/05/21, 07:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/18923

  13. Andreas Kienast voted on patch set 4 V +2 CR +2 11/05/21, 09:34

  14. Andreas Kienast merged patch set 5 11/05/21, 09:34