-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
Cosmetic changes inside php.ini #17282
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure all the cosmetic changes make sense.
; https://php.net/fastcgi.impersonate | ||
;fastcgi.impersonate = 1 | ||
;fastcgi.impersonate = "1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a boolean INI setting or not? If not it may make sense to convert it to one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the documentation this is string. Once it becomes bool I will fix this in the future PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation, especially for INI settings, is not the source of truth. The source code is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, thanks for the input. I'm gonna look up all of the directives inside the source code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 1516 in f90323c
STD_PHP_INI_BOOLEAN("fastcgi.impersonate", "0", PHP_INI_SYSTEM, OnUpdateBool, impersonate, php_cgi_globals_struct, php_cgi_globals) |
@@ -890,83 +893,83 @@ default_socket_timeout = 60 | |||
;auto_detect_line_endings = Off | |||
|
|||
;;;;;;;;;;;;;;;;;;;;;; | |||
; Dynamic Extensions ; | |||
; dynamic extensions ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get these changes, this is using Title Case for "section" titles, which seems adequate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I get the point. However in the curent master there is:
- ; About this file ; (First letter of the first word is uppercase)
- ; Quick Reference ; (First letter of each word is uppercase)
- ; php.ini Options ; (First letter of the second word is uppercase – yes, I know php.ini is a file name)
What's the right convention then?
;;;;;;;;;;;;;;;;;;; | ||
|
||
[CLI Server] | ||
[cli server] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto, these are "section" titles
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, in the current master we've got:
[intl]
[filter]
[mail function] – all lowercase
[Session] – first letter uppercase
[ODBC] – all caps
[MySQLi] but [mysqlnd]
[Pcre]
[bcmath]
Isn't it much simpler to go with lowercase all the way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are extension names so these are proper nouns. Having said that, some of them look incorrect.
- https://www.pcre.org/ should be PCRE
- https://www.php.net/manual/en/book.bc.php & https://github.com/php/php-src/blob/master/ext/bcmath/CREDITS should be BC Math
- filter should probably be Filter https://www.php.net/manual/en/book.filter.php
; Maximum number of links (persistent + non-persistent). -1 means no limit. | ||
; Maximum number of links (persistent + non-persistent). -1 means no limit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double space after a FULL STOP is a convention for English, it is not mandatory but I'm not sure I see the problem with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the php.ini of the current master there are 169 situations where one sentence is followed by another one in the same line. In 44 cases they are separated by double space, in other 125 cases single space is used. Which is why I went for single space.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if this is worth standardizing. A lot of people (especially older generations) prefer double spaces. You're just going to start a debate on which way is more correct.
;mysqli.allow_local_infile = On | ||
;mysqli.allow_local_infile = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this have more options than On/Off?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the documentation this is int.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto, documentation is not the source of truth.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 443 in f90323c
STD_PHP_INI_BOOLEAN("mysqli.allow_local_infile", "0", PHP_INI_SYSTEM, OnUpdateBool, allow_local_infile, zend_mysqli_globals, mysqli_globals) |
mysqli.allow_persistent = On | ||
mysqli.allow_persistent = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Int again: documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 432 in f90323c
STD_PHP_INI_BOOLEAN("mysqli.allow_persistent", "1", PHP_INI_SYSTEM, OnUpdateBool, allow_persistent, zend_mysqli_globals, mysqli_globals) |
; Allow or prevent persistent links. | ||
; https://php.net/pgsql.allow-persistent | ||
pgsql.allow_persistent = On | ||
|
||
; Detect broken persistent links always with pg_pconnect(). | ||
; Auto reset feature requires a little overheads. | ||
; https://php.net/pgsql.auto-reset-persistent | ||
pgsql.auto_reset_persistent = Off |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Int: documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
; Log PostgreSQL backends Notice message or not. | ||
; Unless pgsql.ignore_notice=0, module cannot log notice message. | ||
; Unless pgsql.ignore_notice = 0, module cannot log notice message. | ||
; https://php.net/pgsql.log-notice | ||
pgsql.log_notice = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Boolean INI setting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the documentation this is int.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
I tried something similar few years ago in #7643 but was not successful. I still think a cleanup is due on these files but I don't like the changes in this particular PR. |
Yeah, these things are difficult to standarize as – for instance – half of the people prefer double space between sentences and the other half – single space. But the current situation is that there are multiple conventions used inside a single file, which I belive is even worse than having a bad standarization. |
I would recommend splitting this into several PRs. There are several changes here that I would welcome but many that I disagree with. It would also be easier to review. For example, "equals signs are surrounded by spaces," could be a PR on its own. |
I went through all all of the directives in the source code to check their data types. One thing I noticed is that I couldn't find declarations of the following ones:
Are they still part of PHP? |
STD_PHP_INI_ENTRY("session.trans_sid_tags", "a=href,area=href,frame=src,form=", PHP_INI_ALL, OnUpdateSessionTags, url_adapt_session_ex, php_basic_globals, basic_globals)
STD_PHP_INI_ENTRY("session.trans_sid_hosts", "", PHP_INI_ALL, OnUpdateSessionHosts, url_adapt_session_hosts_ht, php_basic_globals, basic_globals)
STD_PHP_INI_ENTRY("url_rewriter.tags", "form=", PHP_INI_ALL, OnUpdateOutputTags, url_adapt_session_ex, php_basic_globals, basic_globals)
STD_PHP_INI_ENTRY("url_rewriter.hosts", "", PHP_INI_ALL, OnUpdateOutputHosts, url_adapt_session_hosts_ht, php_basic_globals, basic_globals) I believe the two firsts are deprecated tough.. |
This PR fixes #17266. It does some cosmetic changes to php.ini file (dev and prod). Currently inside php.ini there are lot of inconsistencies. This is an attempt to fix those. Main changes are:
SMTP
inside mail function is nowsmtp
),url_rewriter.hosts = ""
),On
/Off
,[]
and;;
are written in all-lowercase convention,