[wp-trac] [WordPress Trac] #37699: Death to Globals Episode #1: A Registry, A Pattern

WordPress Trac noreply at wordpress.org
Fri Oct 14 00:14:30 UTC 2016


#37699: Death to Globals Episode #1: A Registry, A Pattern
----------------------------+------------------------------
 Reporter:  wonderboymusic  |       Owner:
     Type:  enhancement     |      Status:  new
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  General         |     Version:
 Severity:  normal          |  Resolution:
 Keywords:                  |     Focuses:
----------------------------+------------------------------

Comment (by alex-ye):

 Interesting ticket, and nice thoughts, and many long replies.

 +1 for the idea, the globals are bad and have too much risk. their usage
 have to be limited and eventually killed, in the core, plugins and themes.

 I think, the core team will have more implementation options/choices when
 the WordPress requires PHP +5.3, you don't have to rush, if the core team
 plans to move towards PHP +5.3 soon. for now, why you don't offer some
 alternatives for the most common globals like `$wpdb` by maybe a simple
 function like `wp_db()`, and encourage plugins/themes authors to use it
 instead of the `global $wpdb;`, Sorry if it sounds like a stupid
 suggestion, but too much global imports in WP code (core/plugins/themes)
 are there because there is no proper alternative, and until this ticket
 resolved, many developers still have no choice.

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


More information about the wp-trac mailing list