Commit b417db3
committed
WP/AlternativeFunctions: allow for more input streams with file related functions
Similar to 1649 which allowed for using `php://input` with `file_get_contents()` and surprisingly inspired by the closing of issue 295.
This PR expands on the earlier work done in relation to the PHP native input streams by:
* recognizing more PHP native input streams;
* recognizing the PHP input stream constants;
* allowing for these in a number of the `file_system_read` group functions as well as for the `file_get_contents` function.
Refs:
* http://php.net/manual/en/wrappers.php.php
* http://php.net/manual/en/features.commandline.io-streams.php
Includes unit tests.
Related 1649
Related 295
Notes:
* I have not checked the WP FileSystem to see if it even could handle these input streams. If it can, we may need to discuss what is the preferred option in that case.
Personally, this to me seems like something for which the WP FileSystem would be overkill/superfluous.
* At a later point in time, the new method + properties could be a candidate for moving to `Sniff` or a separate utility class.
As no other sniffs currently need them though, this is not necessary at this moment and could possible be combined with/actioned when 1465 comes into play.1 parent d0717e7 commit b417db3
File tree
3 files changed
+111
-13
lines changed- WordPress
- Sniffs/WP
- Tests/WP
3 files changed
+111
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
28 | 69 | | |
29 | 70 | | |
30 | 71 | | |
| |||
83 | 124 | | |
84 | 125 | | |
85 | 126 | | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | 127 | | |
| 128 | + | |
90 | 129 | | |
91 | 130 | | |
92 | 131 | | |
| 132 | + | |
| 133 | + | |
93 | 134 | | |
94 | 135 | | |
95 | 136 | | |
| |||
202 | 243 | | |
203 | 244 | | |
204 | 245 | | |
205 | | - | |
206 | | - | |
207 | | - | |
| 246 | + | |
| 247 | + | |
208 | 248 | | |
209 | 249 | | |
210 | 250 | | |
211 | | - | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
212 | 274 | | |
213 | 275 | | |
214 | 276 | | |
| |||
223 | 285 | | |
224 | 286 | | |
225 | 287 | | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
226 | 313 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | 43 | | |
45 | | - | |
46 | 44 | | |
47 | | - | |
48 | 45 | | |
49 | | - | |
50 | 46 | | |
51 | 47 | | |
52 | 48 | | |
| |||
60 | 56 | | |
61 | 57 | | |
62 | 58 | | |
63 | | - | |
64 | 59 | | |
65 | | - | |
66 | 60 | | |
67 | 61 | | |
68 | 62 | | |
69 | 63 | | |
| 64 | + | |
| 65 | + | |
70 | 66 | | |
71 | 67 | | |
72 | 68 | | |
| |||
0 commit comments