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

Robin Adrianse shorty114 at shorty114.net
Mon Aug 21 04:57:13 GMT 2006


That makes sense -- and having that stuff there increases the likelihood of
it being messed up by somebody not familiar at all with WP. If it works, I
say go for it.

On 8/20/06, Sean Hickey <seanhickey at gmail.com> wrote:
>
> Howdy all,
> I'm not sure if this has been brought up before, but does anything
> think it's not a good idea that the wp-config.php script contains
> require_once(ABSPATH.'wp-settings.php');?
>
> I've got two problems with this:
>
> 1. It's just bad form.  The wp-config.php is designed to hold
> configuration information.  It shouldn't do anymore, or any less.
>
> 2. It makes it impossible to include the wp-config.php script -- to
> get the DB info -- without loading everything else.
>
> 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');
>
> - Sean
> --
> http://www.headzoo.com
> _______________________________________________
> 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