diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2008-06-13 17:21:00 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2008-06-13 17:21:00 +0000 |
commit | 12de05107e4c8b006bde6ee8916f34eb476d08da (patch) | |
tree | 123ee54ecd1f3f777373b7df54a4604012d43640 /wp-load.php | |
parent | e51c7a9ca4bfdb45fa3ec7334bd33871e78c68b1 (diff) | |
download | wordpress-mu-12de05107e4c8b006bde6ee8916f34eb476d08da.tar.gz wordpress-mu-12de05107e4c8b006bde6ee8916f34eb476d08da.tar.xz wordpress-mu-12de05107e4c8b006bde6ee8916f34eb476d08da.zip |
WP Merge with revision 8075
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1328 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-load.php')
-rw-r--r-- | wp-load.php | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/wp-load.php b/wp-load.php new file mode 100644 index 0000000..f912ed6 --- /dev/null +++ b/wp-load.php @@ -0,0 +1,50 @@ +<?php +/** + * Bootstrap file for setting the ABSPATH constant + * and loading the wp-config.php file. The wp-config.php + * file will then load the wp-settings.php file, which + * will then set up the WordPress environment. + * + * If the wp-config.php file is not found then an error + * will be displayed asking the visitor to set up the + * wp-config.php file. + * + * Also made to work in the wp-admin/ folder, because it + * will look in the parent directory if the file is not + * found in the current directory. + * + * @package WordPress + */ + +/** Define ABSPATH as this files directory */ +define( 'ABSPATH', dirname(__FILE__) . '/' ); + +error_reporting(E_ALL ^ E_NOTICE ^ E_USER_NOTICE); + +if ( file_exists( ABSPATH . 'wp-config.php') ) { + + /** The config file resides in ABSPATH */ + require_once( ABSPATH . 'wp-config.php' ); + +} elseif ( file_exists( dirname(ABSPATH) . '/wp-config.php' ) ) { + + /** The config file resides one level below ABSPATH */ + require_once( dirname(ABSPATH) . '/wp-config.php' ); + +} else { + + // A config file doesn't exist + + // Set a path for the link to the installer + if (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false) $path = ''; + else $path = 'wp-admin/'; + + // Die with an error message + require_once( ABSPATH . '/wp-includes/classes.php' ); + require_once( ABSPATH . '/wp-includes/functions.php' ); + require_once( ABSPATH . '/wp-includes/plugin.php' ); + 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 › Error"); + +} + +?> |