[wp-trac] Re: [WordPress Trac] #5090: maybe_create_table call to config.php issue

WordPress Trac wp-trac at lists.automattic.com
Wed Oct 24 18:36:12 GMT 2007

#5090: maybe_create_table call to config.php issue
 Reporter:  mattyrob        |        Owner:  anonymous
     Type:  defect          |       Status:  new      
 Priority:  high            |    Milestone:  2.3.1    
Component:  Administration  |      Version:  2.3      
 Severity:  normal          |   Resolution:           
 Keywords:  has-patch       |  
Comment (by westi):

 Replying to [comment:8 mattyrob]:
 > @Westi,
 > But I'm not including wp-config.php in my plugin - I'm accessing
 maybe_create_table. When I include either upgrade.php or install-
 helper.php THESE file call on wp-config'php using a relational path. As
 the original file executing is coming from the plugin folder (my script)
 the wp-config.php file is reported as not found.
 > By defining the full path to wp-config.php as in the attached diff fixes
 this issue. If you can suggest another way for me to access
 maybe_create_table I'll be more than happy but I only 'require_once' one
 of the two files above as maybe_create_table is not defined (I check is
 with an if (exists()) statement).

 So your plugin file is being called directly rather than in a WordPress
 page load?

 The attached patch can't work if you haven't already got ABSPATH defined
 and that is __normally__ defined in wp-config.php - ideally we should say
 that including install-helper.php requires you to have already pulled in
 wp-config.php and then we could remove the require_once at the top and
 resolve this issue that way.

Ticket URL: <http://trac.wordpress.org/ticket/5090#comment:9>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software

More information about the wp-trac mailing list