[wp-trac] [WordPress Trac] #33112: Suppress calls to ini_set in core

WordPress Trac noreply at wordpress.org
Fri Jul 24 19:53:18 UTC 2015


#33112: Suppress calls to ini_set in core
--------------------------+------------------------------
 Reporter:  mdwheele      |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by mdwheele):

 I'm definitely willing to follow 29330's precedent! Is there somewhere in
 particular I can put a utility function for checking this? If so, please
 advise on the best place to lay this and I'll:

 - Attach a patch that adds the two functions with unit tests
 - Alter my current patch to use these instead

 As far as the `ini_get` dependency is concerned, perhaps that's just where
 we draw the line to avoid using the suppression operator? If we go this
 route, I'm amenable to submit patches against other occurrences of
 suppression operator for the same type of use-case (suppressing `ini_set`
 calls).

 Just let me know!

 Utility functions are something to the tune of:

 {{{
 function is_enabled($function) {
     $disabled_functions=explode(',',ini_get('disable_functions'));
     return ! in_array($function, $disabled_functions);
 }

 function is_disabled($function) {
     return ! is_enabled($function);
 }
 }}}

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


More information about the wp-trac mailing list