WordPress.org

Make WordPress Core

Ticket #29688: 29688.diff

File 29688.diff, 2.5 KB (added by diddledan, 3 years ago)

needs HEAVY testing. moves the require from wp-config-sample.php into wp-load.php!

  • wp-config-sample.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    7979 */
    8080define('WP_DEBUG', false);
    8181
    82 /* That's all, stop editing! Happy blogging. */
    83 
    8482/** Absolute path to the WordPress directory. */
    8583if ( !defined('ABSPATH') )
    8684        define('ABSPATH', dirname(__FILE__) . '/');
    87 
    88 /** Sets up WordPress vars and included files. */
    89 require_once(ABSPATH . 'wp-settings.php');
  • wp-load.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    2323
    2424error_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 );
    2525
     26$_wp_config_file = '';
    2627/*
    2728 * If wp-config.php exists in the WordPress root, or if it exists in the root and wp-settings.php
    28  * doesn't, load wp-config.php. The secondary check for wp-settings.php has the added benefit
     29 * doesn't, set the path to wp-config.php. The secondary check for wp-settings.php has the added benefit
    2930 * of avoiding cases where the current directory is a nested installation, e.g. / is WordPress(a)
    3031 * and /blog/ is WordPress(b).
    31  *
    32  * If neither set of conditions is true, initiate loading the setup process.
    3332 */
    3433if ( file_exists( ABSPATH . 'wp-config.php') ) {
    3534
    36         /** The config file resides in ABSPATH */
    37         require_once( ABSPATH . 'wp-config.php' );
     35    $_wp_config_file = ABSPATH . 'wp-config.php';
    3836
    3937} elseif ( @file_exists( dirname( ABSPATH ) . '/wp-config.php' ) && ! @file_exists( dirname( ABSPATH ) . '/wp-settings.php' ) ) {
    4038
    4139        /** The config file resides one level above ABSPATH but is not part of another install */
    42         require_once( dirname( ABSPATH ) . '/wp-config.php' );
     40        $_wp_config_file = dirname( ABSPATH ) . '/wp-config.php';
     41
     42}
     43
     44/*
     45 * If the path to wp-config.php is set, load it and then load wp-settings.php.
     46 *
     47 * Otherwise, initiate loading the setup process.
     48 */
     49if ( '' !== $_wp_config_file ) {
     50
     51    /** The config file resides in ABSPATH */
     52    require_once( $_wp_config_file );
     53    /** Sets up WordPress vars and included files. */
     54    require_once( ABSPATH . 'wp-settings.php' );
    4355
    4456} else {
    4557