From 91cf173f4a2767ed07a30c5c93236d1e9dfbe9e9 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sun, 26 Sep 2004 10:41:48 +0000 Subject: [PATCH] More informative error message for when the user forgot to move LocalSettings.php. Moved recently-added setup code from index.php to Setup.php where it's meant to be. index.php isn't the only entry point! --- includes/Setup.php | 4 ++++ index.php | 15 +++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/includes/Setup.php b/includes/Setup.php index 983f15dfab..0c2fdbf6bc 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -47,6 +47,10 @@ if( $wgUseSquid && isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) { $wgIP = '127.0.0.1'; } +if ( $wgUseData ) { + $wgExtraNamespaces[20] = 'Data' ; + $wgExtraNamespaces[21] = 'Data_talk' ; +} $fname = 'Setup.php'; wfProfileIn( $fname ); diff --git a/index.php b/index.php index 704f792a8f..ffc481d6b1 100644 --- a/index.php +++ b/index.php @@ -5,9 +5,13 @@ $wgRequestTime = microtime(); unset( $IP ); -@ini_set( "allow_url_fopen", 0 ); # For security... -if(!file_exists("LocalSettings.php")) { - die( "You'll have to set the wiki up first!" ); +@ini_set( 'allow_url_fopen', 0 ); # For security... +if( !file_exists( 'LocalSettings.php' ) ) { + if ( file_exists( 'config/LocalSettings.php' ) ) { + die( "To complete the installation, move config/LocalSettings.php to the parent directory.\n" ); + } else { + die( "You'll have to set the wiki up first!" ); + } } # Valid web server entry point, enable includes. @@ -18,11 +22,6 @@ define( "MEDIAWIKI", true ); require_once( "./includes/Defines.php" ); require_once( "./LocalSettings.php" ); -if ( $wgUseData ) - { - $wgExtraNamespaces[20] = 'Data' ; - $wgExtraNamespaces[21] = 'Data_talk' ; - } require_once( "includes/Setup.php" ); wfProfileIn( "main-misc-setup" ); -- 2.20.1