[wp-trac] [WordPress Trac] #42264: Systematic way of dealing with compat code and polyfills

WordPress Trac noreply at wordpress.org
Thu Mar 29 08:56:47 UTC 2018


#42264: Systematic way of dealing with compat code and polyfills
----------------------------+------------------------------
 Reporter:  schlessera      |       Owner:
     Type:  enhancement     |      Status:  new
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Bootstrap/Load  |     Version:
 Severity:  normal          |  Resolution:
 Keywords:                  |     Focuses:
----------------------------+------------------------------

Comment (by jrf):

 @ayeshrajans All individual back-fills should still be wrapped in
 `function_exists()`, `interface_exists()`, `defined()` calls, just like
 they are now.

 The `extensions_loaded()` logic example was just intended to regulate
 which back-fill files to load.

 > and functions can be disabled in `php.ini` where `extension_loaded`
 would happily return `true`, but `function_exists` doesn't.

 You have a point there which needs further thought, as that would be a
 argument to have the compat bootstrap file have all the
 `function_exists()` checks and have the back-fill files just add
 individual functions, though that would also necessitate each back-fill to
 be in their own file, which might be going over the top a bit with modular
 loading.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/42264#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list