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

WordPress Trac noreply at wordpress.org
Fri Jul 24 20:08:16 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):

 Replying to [comment:6 jdgrimes]:
 > I've just checked, and `ini_get()` is also used 45 other places in core.
 In only 2 places is it prepended with `@`.

 Sweet. Some of those also look like serious dependencies on the return
 value of that function as well. If it's disabled, it returns `NULL` which
 would still operate as long as code dependent on it understood that.

 Either way, we probably need to scope what we want to do here in this
 ticket. I think that since Sergey has linked to us precedent for using
 `ini_get` to detect whether or not a function is enabled, that we should
 press forward with @jdgrimes original suggestion, which would include:

 - Implementing some utility functions: `is_enabled`, `is_disabled`
 (technically optional, but would be a lot of duplicate code everywhere)
 (also, naming is up for debate; `is_enabled` might be unclear)
 - Refreshing my patch to use these new utilities
 - Looking for other instances of `ini_set` and conditionally running them
 based on whether it is enabled.

 That'd probably wrap up *this* ticket with some opportunities for future
 work elsewhere (documenting the functions, sending patches out to popular
 plugins to use functions, etc.)

 Thoughts?

 P.S. @jdgrimes: hope I didn't come across as snarky. I'm bad at text
 communication and usually type things as they come in. Definitely didn't
 mean to sound short or anything!

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


More information about the wp-trac mailing list