[wp-hackers] Moving wp-settings.php out of wp-config.php

Denis de Bernardy denis at semiologic.com
Mon Aug 21 09:31:06 GMT 2006


You cannot simply edit the wp-config.php file: WP users around the world
will _not_ update their wp-config.php file next time they upgrade their WP
install. You need to add the relevant lines to the wp-settings.php file.

D.

> -----Original Message-----
> From: wp-hackers-bounces at lists.automattic.com 
> [mailto:wp-hackers-bounces at lists.automattic.com] On Behalf Of 
> Mark Jaquith
> Sent: Monday, August 21, 2006 8:21 AM
> To: wp-hackers at lists.automattic.com
> Subject: Re: [wp-hackers] Moving wp-settings.php out of wp-config.php
> 
> 
> On Aug 20, 2006, at 9:21 AM, Sean Hickey wrote:
> 
> > The fix is simply adding the line 
> > require_once(ABSPATH.'wp-settings.php'); below the require_once(
> > dirname(__FILE__) . '/wp-config.php'); in the wp-blog-header.php 
> > script.  Then the wp-config.php can act exactly as it 
> should -- as the 
> > script that holds the DB connection information.
> >
> > Not wanting to break any existing plugins, the wp-config.php script 
> > could check for a defined constant, and if that constant is 
> TRUE, it 
> > skips the inclusion of the wp-settings.php.  That way all 
> old plugins 
> > still work, but new plugins can use wp-config.php the way 
> it was meant 
> > to be used.  I could do something like:
> >
> > define('CONFIG_NOLOAD', true);
> > include('wp-config.php');
> 
> This works for me, as nothing needs to change for plugin or 
> WP-tie-in  
> uses.  If you think there is a need for 3rd party scripts to 
> load the  
> DB info and constants, but not WP's core functions, then this would  
> be a good way to do it.  Since this is such a small thing (4 or 5  
> line patch), you should probably just go ahead and code it up 
> for all  
> to see on Trac.
> 
> --
> Mark Jaquith
> http://txfx.net/
> 
> 
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com 
> http://lists.automattic.com/mailman/listinfo/wp-hackers
> 



More information about the wp-hackers mailing list