WordPress.org

Ready to get started?Download WordPress

Forums

Feature Request: wp-load.php - Multi environment config selection (2 posts)

  1. DrewBroadley
    Member
    Posted 3 years ago #

    Hi there,

    I'm constantly adding this to my wp-config.php file, and I saw it's only a minor addition to wp-load.php in the WordPress root folder.

    Adding the following line adds the ability for dev, test, live plus any others to have individualised settings:

    --- wp-load.php	2011-02-01 17:01:36.000000000 +1300
    +++ wp-load.multihost.php	2011-02-01 17:01:33.000000000 +1300
    @@ -19,12 +19,18 @@
     /** Define ABSPATH as this files directory */
     define( 'ABSPATH', dirname(__FILE__) . '/' );
    
    +
     if ( defined('E_RECOVERABLE_ERROR') )
     	error_reporting(E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR);
     else
     	error_reporting(E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING);
    
    -if ( file_exists( ABSPATH . 'wp-config.php') ) {
    +$host_config_file = (ABSPATH . 'wp-config-' . preg_replace("/[^a-z0-9\-\.]+/","", $_SERVER['HTTP_HOST']) . '.php');
    +if (file_exists($host_config_file))
    +{
    +	require_once($host_config_file);
    +}
    +else if ( file_exists( ABSPATH . 'wp-config.php') ) {
    
     	/** The config file resides in ABSPATH */
     	require_once( ABSPATH . 'wp-config.php' );

    Would be great to see something similar in wp-load.php

  2. Can you submit that at trac.wordpress.org ?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.