[wp-trac] [WordPress Trac] #48091: Remove conditional use of PHP stream_get_contents()
WordPress Trac
noreply at wordpress.org
Mon Feb 10 04:38:53 UTC 2020
#48091: Remove conditional use of PHP stream_get_contents()
----------------------------+--------------------------------------------
Reporter: jrf | Owner: SergeyBiryukov
Type: task (blessed) | Status: reviewing
Priority: normal | Milestone: 5.4
Component: General | Version: 5.3
Severity: normal | Resolution:
Keywords: has-patch | Focuses: performance, coding-standards
----------------------------+--------------------------------------------
Comment (by SergeyBiryukov):
Replying to [ticket:48091 jrf]:
> While working on #48075 / looking for code which can be removed now
support for PHP < 5.6.20 has been dropped, I came across three instances
where checks were done for the existance of the `stream_get_contents()`
function.
Introduced in [11632] / #10093, as a follow-up to [11063] / #8210.
I think it should indeed be safe to remove these checks now that we're on
PHP 5.6.20+, same as JSON workarounds and polyfills were removed in
[46205-46206,46208] / #47699.
However, just in case, would it make sense to add an upgrade check for
`stream_get_contents()`, like [46455]?
> I strongly believe the reason is **1)** and that the removal of these
conditions is long overdue, if for no other reason than that the function
is used unconditionally in the
[https://core.trac.wordpress.org/browser/trunk/src/wp-
includes/pomo/mo.php#L76 `mo.php`] file.
Worth noting that `mo.php` only uses it in he `MO::export()` method, which
is unused in core.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/48091#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list