Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 33 lines (21 sloc) 1.274 kb
5b81135 Allow wp-config.php to exist one level up from WordPress root directory....
ryan authored
1 <?php
2
3 // Define ABSPATH as this files directory
4 define( 'ABSPATH', dirname(__FILE__) . '/' );
5
6 if ( file_exists( ABSPATH . 'wp-config.php') ) {
7
8 // The config file resides in ABSPATH
9 require_once( ABSPATH . 'wp-config.php' );
10
11 } elseif ( file_exists( dirname(ABSPATH) . '/wp-config.php' ) ) {
12
13 // The config file resides one level below ABSPATH
14 require_once( dirname(ABSPATH) . '/wp-config.php' );
15
16 } else {
17
18 // A config file doesn't exist
19
20 // Set a path for the link to the installer
21 if (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false) $path = '';
22 else $path = 'wp-admin/';
23
24 // Die with an error message
25 require_once( ABSPATH . '/wp-includes/classes.php' );
26 require_once( ABSPATH . '/wp-includes/functions.php' );
27 require_once( ABSPATH . '/wp-includes/plugin.php' );
28 wp_die("There doesn't seem to be a <code>wp-config.php</code> file. I need this before we can get started. Need more help? <a href='http://codex.wordpress.org/Editing_wp-config.php'>We got it</a>. You can create a <code>wp-config.php</code> file through a web interface, but this doesn't work for all server setups. The safest way is to manually create the file.</p><p><a href='{$path}setup-config.php' class='button'>Create a Configuration File</a>", "WordPress &rsaquo; Error");
29
30 }
31
32 ?>
Something went wrong with that request. Please try again.