From: Tim Starling Date: Tue, 7 Jun 2011 05:11:50 +0000 (+0000) Subject: * Restored the page shown when LocalSettings.php is missing to how it was before... X-Git-Tag: 1.31.0-rc.0~29643 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=26230b6feef4db7fa2b72e514799c271d151e45a;p=lhc%2Fweb%2Fwiklou.git * Restored the page shown when LocalSettings.php is missing to how it was before r85918. That template is a welcome page, not a "catastrophic error". * Fixed attempted remote loading of the logo image in index.php's wfDie(). Use the distributed mediawiki.png instead, that's what it's there for. --- diff --git a/includes/WebStart.php b/includes/WebStart.php index 6ace96cc7b..5e3b42d4ff 100644 --- a/includes/WebStart.php +++ b/includes/WebStart.php @@ -111,26 +111,8 @@ if ( defined( 'MW_CONFIG_CALLBACK' ) ) { # the wiki installer needs to be launched or the generated file uploaded to # the root wiki directory if( !file_exists( MW_CONFIG_FILE ) ) { - $script = $_SERVER['SCRIPT_NAME']; - $path = htmlspecialchars( str_replace( '//', '/', pathinfo( $script, PATHINFO_DIRNAME ) ) ); - $ext = htmlspecialchars( pathinfo( $script, PATHINFO_EXTENSION ) ); - - # Check to see if the installer is running - if ( !function_exists( 'session_name' ) ) { - $installerStarted = false; - } else { - session_name( 'mw_installer_session' ); - $oldReporting = error_reporting( E_ALL & ~E_NOTICE ); - $success = session_start(); - error_reporting( $oldReporting ); - $installerStarted = ( $success && isset( $_SESSION['installData'] ) ); - } - - $please = $installerStarted - ? "Please complete the installation and download LocalSettings.php." - : "Please set up the wiki first."; - - wfDie( "

LocalSettings.php not found.

$please

" ); + require_once( "$IP/includes/templates/NoLocalSettings.php" ); + die(); } # Include site settings. $IP may be changed (hopefully before the AutoLoader is invoked) diff --git a/includes/templates/NoLocalSettings.php b/includes/templates/NoLocalSettings.php new file mode 100644 index 0000000000..9001e3ba8e --- /dev/null +++ b/includes/templates/NoLocalSettings.php @@ -0,0 +1,64 @@ + + + + + MediaWiki <?php echo htmlspecialchars( $wgVersion ) ?> + + + + + The MediaWiki logo + +

MediaWiki

+
+

LocalSettings.php not found.

+

+ complete the installation and download LocalSettings.php." ); + } else { + echo( "Please set up the wiki first." ); + } + ?> +

+ +
+ + diff --git a/index.php b/index.php index c7d0f92d11..36c9974816 100644 --- a/index.php +++ b/index.php @@ -180,9 +180,15 @@ function wfDie( $errorMsg ){ $version = isset( $wgVersion ) && $wgVersion ? htmlspecialchars( $wgVersion ) : ''; + + $script = $_SERVER['SCRIPT_NAME']; + $path = pathinfo( $script, PATHINFO_DIRNAME ) . '/'; + $path = str_replace( '//', '/', $path ); + $logo = isset( $wgLogo ) && $wgLogo ? $wgLogo - : 'http://upload.wikimedia.org/wikipedia/commons/1/1c/MediaWiki_logo.png'; + : $path . 'skins/common/images/mediawiki.png'; + $encLogo = htmlspecialchars( $logo ); header( $_SERVER['SERVER_PROTOCOL'] . ' 500 MediaWiki configuration Error', true, 500 ); header( 'Content-type: text/html; charset=UTF-8' );