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/wp-load.php
+++ b/wp-load.php
@@ -33,7 +33,12 @@ error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_W
  *
  * If neither set of conditions is true, initiate loading the setup process.
  */
-if ( file_exists( ABSPATH . 'wp-config.php') ) {
+if ($config = getenv('WP_CONFIG_FILE') {
+
+	/** Custom path to config file */
+	require_once($config);
+
+} elseif ( file_exists( ABSPATH . 'wp-config.php') ) {
 
 	/** The config file resides in ABSPATH */
 	require_once( ABSPATH . 'wp-config.php' );
-- 
2.10.0

