rfc:date.timezone_warning_removal
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
rfc:date.timezone_warning_removal [2015/01/27 00:41] – bwoebi | rfc:date.timezone_warning_removal [2015/02/15 17:26] – typo bwoebi | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== PHP RFC: Remove the date.timezone warning ====== | ====== PHP RFC: Remove the date.timezone warning ====== | ||
- | * Version: 1.0 | + | * Version: 1.1 |
* Date: 2015-01-27 | * Date: 2015-01-27 | ||
* Author: Bob Weinand, bobwei9@hotmail.com | * Author: Bob Weinand, bobwei9@hotmail.com | ||
Line 7: | Line 7: | ||
===== Introduction ===== | ===== Introduction ===== | ||
- | Each time we use date() | + | PHP should be usable without configuring it through either an ini file or defining settings on the command line. Currently this is not possible as the date.timezone |
- | Thus, I'd like to remove this warning in favor of a better user experience. | + | " |
+ | |||
+ | The error message becomes entirely tedious when working with anything other than a single installed version | ||
+ | |||
+ | For example when you want to run the unit tests for a library against all the different versions of PHP that library supports, you should be able to do so by downloading each of the PHP versions you want to test against, and invoking the PHP executables from the download location, rather than having to install it first. | ||
===== Proposal ===== | ===== Proposal ===== | ||
- | Removing | + | The current behaviour when the data.timezone ini entry is not set is to: |
- | The date.timezone | + | * Default to UTC. |
+ | * Give a warning | ||
- | It is not safe to rely on the system' | + | The proposal |
===== Proposed PHP Version(s) ===== | ===== Proposed PHP Version(s) ===== | ||
- | Targeting the next minor version. | + | Targeting the next minor version. |
===== Unaffected PHP Functionality ===== | ===== Unaffected PHP Functionality ===== | ||
If the date.timezone ini setting is set but invalid, a warning is still thrown. | If the date.timezone ini setting is set but invalid, a warning is still thrown. | ||
- | The default | + | |
+ | ===== Feedback ===== | ||
+ | ==== " | ||
+ | No. For users who install PHP through a distribution, | ||
+ | |||
+ | For end users who compile from source they can either modify the ini file that is used by PHP in the compile step or they could add it themselves when PHP is built e.g. For Debian they could easily stick the following in a post-install hook to fix it: | ||
+ | |||
+ | echo ' | ||
+ | |||
+ | People who are compiling PHP from source are perfectly capable of setting all ini settings that need to be set. | ||
+ | |||
+ | The only people who this RFC will affect are: | ||
+ | |||
+ | * Those who use multiple versions of PHP or otherwise use PHP without going through the install process. This RFC will be beneficial to these users. | ||
+ | * People who have accidentally deleted their ini files from their production system. These users have bigger issues than this RFC can address. | ||
+ | |||
+ | ==== "Users are idiots and can't be trusted" | ||
+ | Well, yes. But there are many things that must be set in an ini file for PHP to be usable in a production environment. The person installing PHP needs to be capable of setting all of these. The timezone setting is not the most important setting that needs to be set so it's not good that PHP gives a warning message when it is not set. | ||
+ | |||
+ | ==== " | ||
+ | This is a painful hack. For people who spend a significant amount of time either developing PHP, PHP extensions or testing userland code against multiple PHP versions, they should be able to run PHP code without getting slapped for the temerity of not using an ini file and without being forced to set an ini setting to the same default value it is going to use anyway. | ||
===== Proposed Voting Choices ===== | ===== Proposed Voting Choices ===== | ||
Line 39: | Line 65: | ||
* https:// | * https:// | ||
* https:// | * https:// | ||
+ | |||
+ | ===== Versions ===== | ||
+ | |||
+ | * 1.0: Initial RFC (2015-01-27) | ||
+ | * 1.1: More neutral wording, discussion of feedback (2015-02-15) |
rfc/date.timezone_warning_removal.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1