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

Probably a very minor request, but can PECL's timezoneDB be made into a layer? #534

Open
rquadling opened this issue Feb 22, 2024 · 5 comments

Comments

@rquadling
Copy link

The TimeZoneDB extension is pretty important when working with datetime on a global basis. The extension itself is VERY VERY minimal from a "code" perspective. It is more about "data" that is maintained externally and pulled into the extension when the things change.

It is a drop-in replacement to the version that is statically compiled into the PHP binary (assuming standard building) and is how all date functions, class, methods, etc. work. Add the drop-in, nothing except data changes and is only updated to be more accurate.

The updates to Olson and then the PECL TimeZoneDB are not related to deployments of PHP. From memory, the extension is compatible with ALL versions of PHP (it really is JUST some data ... a LOT of data though!).

@fredericgboutin-yapla
Copy link

Yeah, I agree, it is mind boggling how this is not a default extension in Docker official images as well because it leads to stupid bugs with timezone.

@mnapoli
Copy link
Member

mnapoli commented Nov 19, 2024

Hey! I wonder if this is (or could be) available through a Composer package? Distribution and installation would be much simpler.

@fredericgboutin-yapla
Copy link

fredericgboutin-yapla commented Nov 19, 2024

I wondered the very same thing this morning 😅 but I doubt. When I think about the DateTime object and nest/carbon, they all seem to rely deep down on the PHP framework itself.

It seems there is nothing of interest - https://packagist.org/?query=timezone

To be fair, the extension documentation stipulates this,

You should only install this extension in case you need to get a later version of the timezone database than the one that ships with PHP - ©

The more I think about this the more I think this is related to the active support state of the PHP version in use.

For example, PHP 7.4, which is not supported anymore, has a database version 2022.1 on 7.4.33 and that version of PHP released on Nov 2022.

In the mean time, PHP 8.2/3 are using the very latest version. PHP 8.1 is not, since its "active support" ended in Nov 2023.

echo timezone_version_get();

image

https://onlinephp.io/c/d7311

I guess, what I'm trying to say is that, I think that as long as people are using an up to date / supported version of PHP, then the timezone database seems fairly up to date already - https://www.php.net/supported-versions.php

From memory, the extension is compatible with ALL versions of PHP

Yes, I installed the extension in the official docker image for PHP 7.4 and it worked flawlessly.

@mnapoli
Copy link
Member

mnapoli commented Nov 19, 2024

I guess, what I'm trying to say is that, I think that as long as people are using an up to date / supported version of PHP, then the timezone database seems fairly up to date already.

oh good to know!

@rquadling
Copy link
Author

You can't always update to the latest release as there may be dependencies that are not compatible. As this specific extension is pretty much universal, being able to update it would be a "good thing".

As PHP is NOT responsible for countries around the world changing, adding historic, or correcting their timezone information, and those changes NOT coinciding with an official PHP release for this 1 extension, the extension is very "different" in this regard. It is pretty much just data. Being able to add it in an easy manner (ideally on change from PECL), or, at least, a well documented process that doesn't get in the way of BrefPHP doing its thing, would be ideal.

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

No branches or pull requests

3 participants