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

TstampTask impacted by deprecation #1682

Closed
jawira opened this issue Aug 8, 2022 · 3 comments
Closed

TstampTask impacted by deprecation #1682

jawira opened this issue Aug 8, 2022 · 3 comments
Milestone

Comments

@jawira
Copy link
Contributor

jawira commented Aug 8, 2022

strftime() function was deprecated in PHP 8.1 and is going to be removed in PHP 9. The problem is that TstampTask relies a lot on this function.

As php.watch explains, \IntlDateFormatter can be used to replace strftime().

However, be aware that using \IntlDateFormatter will provoke a breaking change because the syntax used to declare a custom pattern is completely different.

<tstamp>
  <format property="DATE" pattern="%Y%m%d"/>
</tstamp>

Things like %Y%m%d are not going to work anymore because \IntlDateFormatter uses ICU syntax.

<tstamp>
  <format property="DATE" pattern="yyyyMMdd"/>
</tstamp>

Anyway, I'm more than willing to work in this issue, so let me know what do you think and if you need help with this :)

@jawira
Copy link
Contributor Author

jawira commented Aug 9, 2022

I was thinking about this. If TstampTask is updated, all old buildfiles will silently fail due to the new syntax, people will not understand why timestamps are not working anymore. Maybe it's a better idea to deprecate TstampTask (and display a warning) and create a new task -e.g. TimestampTask- which uses ICU syntax?

@mrook
Copy link
Member

mrook commented Aug 9, 2022

As @siad007 said on Slack, we'd prefer to keep the existing task. Can we (easily) convert non-ICU to ICU syntax? And warn the user that this is happening?

@jawira
Copy link
Contributor Author

jawira commented Aug 9, 2022

Hi, can you please check #1683 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants