Make WordPress Core

Ticket #38204: 0001-allow-custom-pathname-to-configuration.patch

File 0001-allow-custom-pathname-to-configuration.patch, 993 bytes (added by gdamjan, 7 years ago)

allow-custom-pathname-to-configuration.patch

  • wp-load.php

    From a5dd0df9521cba2e63a6052011db7d17ce7dd6aa Mon Sep 17 00:00:00 2001
    From: Damjan Georgievski <gdamjan@gmail.com>
    Date: Sat, 1 Oct 2016 17:01:38 +0200
    Subject: [PATCH] allow custom pathname to configuration
    
    configure the pathname to the `wp-config.php` file with a
    `WP_CONFIG_FILE` environment variable.
    ---
     wp-load.php | 7 ++++++-
     1 file changed, 6 insertions(+), 1 deletion(-)
    
    diff --git a/wp-load.php b/wp-load.php
    index 76dda74..1a8d102 100644
    a b error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_W 
    3333 *
    3434 * If neither set of conditions is true, initiate loading the setup process.
    3535 */
    36 if ( file_exists( ABSPATH . 'wp-config.php') ) {
     36if ($config = getenv('WP_CONFIG_FILE') {
     37
     38        /** Custom path to config file */
     39        require_once($config);
     40
     41} elseif ( file_exists( ABSPATH . 'wp-config.php') ) {
    3742
    3843        /** The config file resides in ABSPATH */
    3944        require_once( ABSPATH . 'wp-config.php' );