WordPress.org

Make WordPress Core

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

File 0001-allow-custom-pathname-to-configuration.2.patch, 1.1 KB (added by gdamjan, 19 months ago)

updated patch to latest HEAD

  • wp-load.php

    From 11f16f1aed6f0f880ed9105548a63890c0aa3a4a Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?=D0=94=D0=B0=D0=BC=D1=98=D0=B0=D0=BD=20=D0=93=D0=B5=D0=BE?=
     =?UTF-8?q?=D1=80=D0=B3=D0=B8=D0=B5=D0=B2=D1=81=D0=BA=D0=B8?=
     <gdamjan@gmail.com>
    Date: Thu, 11 Apr 2019 20:38:48 +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 21cba39011..f699b7b0b5 100644
    a b error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_W 
    3131 *
    3232 * If neither set of conditions is true, initiate loading the setup process.
    3333 */
    34 if ( file_exists( ABSPATH . 'wp-config.php' ) ) {
     34if ($config = getenv('WP_CONFIG_FILE') {
     35
     36        /** Custom path to config file */
     37        require_once($config);
     38
     39} elseif ( file_exists( ABSPATH . 'wp-config.php') ) {
    3540
    3641        /** The config file resides in ABSPATH */
    3742        require_once( ABSPATH . 'wp-config.php' );