Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 331ac35

Browse files
Fix visibility of whitespace in config output (#18527)
When a config var has whitespace (especially trailing whitespace) it is hard to see. This commit wraps the values (if they exist) in double quotes, so the difference is visually observable: Before: ``` $ export PHP_INI_SCAN_DIR="/opt/homebrew/etc/php/8.4/conf.d " $ ./sapi/cli/php --ini Configuration File (php.ini) Path: /usr/local/lib Loaded Configuration File: /opt/homebrew/etc/php/8.4/conf.d Scan for additional .ini files in: (none) Additional .ini files parsed: (none) ``` > Note > The above output has trailing whitespace that is not visible, you can see it if you copy it into an editor: After: ``` $ ./sapi/cli/php --ini Configuration File (php.ini) Path: "/usr/local/lib" Loaded Configuration File: "/opt/homebrew/etc/php/8.4/conf.d " Scan for additional .ini files in: (none) Additional .ini files parsed: (none) ``` Above the whitespace is now visible `/opt/homebrew/etc/php/8.4/conf.d `. Close #18390
1 parent e11a702 commit 331ac35

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

‎sapi/cli/php_cli.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,9 +1106,17 @@ static int do_cli(int argc, char **argv) /* {{{ */
11061106

11071107
case PHP_CLI_MODE_SHOW_INI_CONFIG:
11081108
{
1109-
zend_printf("Configuration File (php.ini) Path: %s\n", PHP_CONFIG_FILE_PATH);
1110-
zend_printf("Loaded Configuration File: %s\n", php_ini_opened_path ? php_ini_opened_path : "(none)");
1111-
zend_printf("Scan for additional .ini files in: %s\n", php_ini_scanned_path ? php_ini_scanned_path : "(none)");
1109+
zend_printf("Configuration File (php.ini) Path: \"%s\"\n", PHP_CONFIG_FILE_PATH);
1110+
if (php_ini_scanned_path) {
1111+
zend_printf("Loaded Configuration File: \"%s\"\n", php_ini_scanned_path);
1112+
} else {
1113+
zend_printf("Loaded Configuration File: (none)\n");
1114+
}
1115+
if (php_ini_opened_path) {
1116+
zend_printf("Scan for additional .ini files in: \"%s\"\n", php_ini_opened_path);
1117+
} else {
1118+
zend_printf("Scan for additional .ini files in: (none)\n");
1119+
}
11121120
zend_printf("Additional .ini files parsed: %s\n", php_ini_scanned_files ? php_ini_scanned_files : "(none)");
11131121
break;
11141122
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /