Last active
September 27, 2015 08:37
-
-
Save ptahdunbar/1241505 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Find wp-config.php | |
for ( $i = 0; $i < $depth = 10; $i++ ) { | |
$path = str_repeat( '../', $i ); | |
if ( file_exists( $path . 'wp-config.php' ) ) { | |
require_once( $path . 'wp-config.php' ); | |
break; | |
} | |
} | |
// v2 | |
define('SHORTINIT', true); | |
// Find wp-config.php | |
$subdirectory = 'wp/'; | |
for ( $i = 0; $i < $depth = 10; $i++ ) { | |
$path = str_repeat( '../', $i ); | |
$dir = rtrim(realpath($path . $subdirectory), '/'); | |
if ( file_exists( $dir . '/wp-load.php' ) ) { | |
require_once( $dir . '/wp-config.php' ); | |
break; | |
} else if ( file_exists( $dir . '/../wp-config.php' ) ) { | |
require_once( $dir . '/../wp-config.php' ); | |
break; | |
} | |
} | |
// find wp-load.php | |
// Find wp-load.php | |
$subdirectory = 'wp/'; | |
for ( $i = 0; $i < $depth = 10; $i++ ) { | |
$path = str_repeat( '../', $i ); | |
$dir = rtrim(realpath($path . $subdirectory), '/'); | |
if ( file_exists( $dir . '/wp-load.php' ) ) { | |
require_once( $dir . '/wp-load.php' ); | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment