Skip to content

Remove date.default_latitude and .default_longitude inis #4423

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

Closed
wants to merge 1 commit into from

Conversation

cmb69
Copy link
Member

@cmb69 cmb69 commented Jul 16, 2019

The only purpose of these ini settings is to serve as defaults for
date_sunrise() and date_sunset(), which is is obviously of limited
usefulness.

This topic came up in PR #4412, and this PR is meant as a base for discussing and evaluating what to do with these INI settings. See also https://externals.io/message/26033 for a former discussion about changing the default values of the settings.

cc @derickr

The only purpose of these ini settings is to serve as defaults for
`date_sunrise()` and `date_sunset()`, which is is obviously of limited
usefulness.
case 3:
longitude = INI_FLT("date.default_longitude");
longitude = DATE_DEFAULT_LONGITUDE;
Copy link
Member

Choose a reason for hiding this comment

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

Having these as ini's still made some small sense in that you could configure your server for your location (if such a thing exists) -- but a hardcoded default is completely useless. If we drop the ini settings, these parameters should be required.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree that these parameters should not have a default, but they come after the optional $format parameter. :(

Copy link
Member

Choose a reason for hiding this comment

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

That would have to become required as well ... people would have had to specify it for any realistic use of the function anyway, to get at the lat/long parameters.

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay, but in this case we should have deprecated relying on the defaults in PHP 7.4. Guess it's too late now. Postpone? @derickr ?

Copy link
Member

Choose a reason for hiding this comment

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

A bit unfortunate that this didn't make it into the 7.4 deprecations. I guess this isn't particularly critical though and we can deprecate for 8.0?

Copy link
Member Author

Choose a reason for hiding this comment

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

Given that this topic has been brought up 12 years ago, I don't think it's critical, so deprecating for 8.0 would be fine for me.

Copy link
Member

Choose a reason for hiding this comment

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

Same here. tbh, if I really got my way, I'd deprecate the two functions.

Copy link
Member

Choose a reason for hiding this comment

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

To make sure we don't forget about it, I've created https://wiki.php.net/rfc/deprecations_php_8_0 and added a stub for this. If anyone wants to fill out the argument, feel free :)

@nikic
Copy link
Member

nikic commented Jul 24, 2019

As it looks like we'll go with a different approach, can this be closed?

@cmb69
Copy link
Member Author

cmb69 commented Jul 24, 2019

Closing this is fine for me.

@cmb69 cmb69 closed this Jul 24, 2019
@cmb69 cmb69 deleted the date-latitude-longitude branch September 29, 2019 14:07
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.

3 participants