[wp-trac] Re: [WordPress Trac] #5860: Activating plugin that uses upgrade functions (dbDelta) fails

WordPress Trac wp-trac at lists.automattic.com
Fri Feb 15 14:11:48 GMT 2008


#5860: Activating plugin that uses upgrade functions (dbDelta) fails
----------------------------+-----------------------------------------------
 Reporter:  jhodgdon        |        Owner:  ryan
     Type:  defect          |       Status:  new 
 Priority:  normal          |    Milestone:  2.5 
Component:  Administration  |      Version:  2.5 
 Severity:  critical        |   Resolution:      
 Keywords:  has-patch       |  
----------------------------+-----------------------------------------------
Comment (by darkdragon):

 I'm basically just playing devil's advocate here, so whatever decision is
 not going to affect me whatsoever.

 Why not just put the rest of the code in a function? You would have to
 make $wpdb a global and it isn't going to call the code until it is
 needed. The overhead is slight. You would have to make those variables
 globals in the functions that call them.

 My argument basically breaks down, because no one is going to be looking
 at scheme.php anyway. I would be more comfortable in which case, when a
 developer did look at that file that they knew the reason why $wpdb was
 being declared a global, so that they don't adopt the practice as their
 own.

 I really hate it when the function body is split up into separate files
 (and isn't HTML), because it makes it difficult to (initially) follow the
 flow.

 To be honest, I could basically care less, but the people that criticize
 will just have one more (minor) example to throw at the !WordPress world.
 It is in my opinion, that the only ones that will be calling wp-
 admin/includes/scheme.php is !WordPress, which means that that 1) there
 shouldn't be that many files and functions including the file and 2) that
 the better, or best fix will be worth implementing in !WordPress.

 Since well, I've bought this up and argued the issue, I might as well
 provide the patch.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/5860#comment:12>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list