You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-15Lines changed: 12 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -187,25 +187,22 @@ foreach ($info->modules() as $module) {
187
187
188
188
## Why not just use `ini_get()` or `extension_loaded()`?
189
189
190
-
PHP scatters its configuration across a handful of narrow functions, each with its own scope:
190
+
PHP configuration is spread across a bunch of different functions, each with a narrow scope:
191
191
192
-
| Function | What it gives you |
193
-
|---|---|
194
-
|`ini_get()`| A single INI value — and only the local (effective) value |
195
-
|`extension_loaded()`| Whether an extension is loaded (boolean) |
196
-
|`get_loaded_extensions()`| A list of extension names — no configuration details |
197
-
|`phpversion()`| The PHP version string |
198
-
|`php_uname()`| OS info |
192
+
-`ini_get()` returns a single INI value, and only the local (effective) value
193
+
-`extension_loaded()` tells you if an extension is loaded, but nothing about its configuration
194
+
-`get_loaded_extensions()` gives you a list of names with no details
195
+
-`phpversion()` and `php_uname()` each return one thing
199
196
200
-
Every one of these requires you to **know exactly what you're asking for ahead of time**. There's no way to discover what's available, iterate over all configuration, or search across modules.
197
+
All of these require you to know exactly what you're looking for ahead of time. There's no way to discover what's available, iterate over all configuration, or search across modules.
201
198
202
-
And even if you combine all of them, there are things they simply **cannot tell you** — the configure command PHP was compiled with, Zend extension details, stream wrappers, registered filters, and per-extension metadata that only `phpinfo()` exposes.
199
+
Even if you combine all of them, there are things they simply can't tell you. The configure command PHP was compiled with, Zend extension details, stream wrappers, registered filters, and various per-extension metadata are only available through `phpinfo()`.
203
200
204
-
`phpinfo()` is the **only** function that gives you everything in one place. The problem is it outputs raw HTML (or plain text in CLI) with no API to work with.
201
+
`phpinfo()` is the only function that gives you everything in one place. The problem is it dumps raw HTML (or plain text in CLI) with no API to work with.
205
202
206
203
This package parses that complete `phpinfo()` output and gives you:
207
204
208
-
-**Discovery without foreknowledge** — iterate over all modules and configs without knowing what's installed
209
-
-**Both local and master values** — `ini_get()` only returns the effective local value; this package gives you both so you can see what was overridden
210
-
-**Access to phpinfo()-only data** — compile options, stream wrappers, registered filters, and other details that no other PHP function exposes
211
-
-**A single, consistent API** — instead of juggling five different functions with different return types, query everything through one interface
205
+
-Iterate over all modules and configs without knowing what's installed
206
+
-Get both local and master values (`ini_get()` only returns the effective local value)
207
+
- Access phpinfo()-only data like compile options, stream wrappers, and registered filters
208
+
-One consistent APIinstead of juggling five different functions with different return types
0 commit comments