forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit 2a9d417
Only quote
A comment in php#18527 mentioned that many scripts use `php—-ini` to bootstrap information about the system. Searching on GitHub confirms that many places will not work with quotes out of the box: https://github.com/search?q=content%3A%22php%20--ini%22&type=code.
Many seem to be variants on this pattern
```
$ echo "extension=mongodb.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
```
To preserve these existing scripts, we can detect when the output is a TTY to optionally quote them. This is the new behavior:
Output is a tty:
```
$ make -j$(nproc) &> /dev/null && env PHP_INI_SCAN_DIR="/opt/homebrew/etc/php/8.4/conf.d " PHPRC="/opt/homebrew/etc/php/8.4" ./sapi/cli/php --ini
Configuration File (php.ini) Path: "/usr/local/lib"
Loaded Configuration File: "/opt/homebrew/etc/php/8.4/php.ini"
Scan for additional .ini files in: "/opt/homebrew/etc/php/8.4/conf.d "
Additional .ini files parsed: (none)
```
Output is not a tty:
```
$ make -j$(nproc) &> /dev/null && env PHP_INI_SCAN_DIR="/opt/homebrew/etc/php/8.4/conf.d " PHPRC="/opt/homebrew/etc/php/8.4" ./sapi/cli/php --ini | tee
Configuration File (php.ini) Path: /usr/local/lib
Loaded Configuration File: /opt/homebrew/etc/php/8.4/php.ini
Scan for additional .ini files in: /opt/homebrew/etc/php/8.4/conf.d
Additional .ini files parsed: (none)
```php --ini
values when out is a tty1 parent 292ea25 commit 2a9d417
1 file changed
+1
-1
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
17 | - | ||
17 | + | ||
18 | 18 |
| |
19 | 19 |
| |
20 | 20 |
| |
|
0 commit comments