r89626 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89625‎ | r89626 | r89627 >
Date:05:39, 7 June 2011
Author:tstarling
Status:ok
Tags:
Comment:
MFT r89624, r89625: restored NoLocalSettings.php
Modified paths:
  • /branches/REL1_18/phase3/includes/WebStart.php (modified) (history)
  • /branches/REL1_18/phase3/includes/templates/NoLocalSettings.php (added) (history)
  • /branches/REL1_18/phase3/index.php (modified) (history)

Diff [purge]

Index: branches/REL1_18/phase3/includes/WebStart.php
@@ -120,26 +120,8 @@
121121 # the wiki installer needs to be launched or the generated file uploaded to
122122 # the root wiki directory
123123 if( !file_exists( MW_CONFIG_FILE ) ) {
124 - $script = $_SERVER['SCRIPT_NAME'];
125 - $path = htmlspecialchars( str_replace( '//', '/', pathinfo( $script, PATHINFO_DIRNAME ) ) );
126 - $ext = htmlspecialchars( pathinfo( $script, PATHINFO_EXTENSION ) );
127 -
128 - # Check to see if the installer is running
129 - if ( !function_exists( 'session_name' ) ) {
130 - $installerStarted = false;
131 - } else {
132 - session_name( 'mw_installer_session' );
133 - $oldReporting = error_reporting( E_ALL & ~E_NOTICE );
134 - $success = session_start();
135 - error_reporting( $oldReporting );
136 - $installerStarted = ( $success && isset( $_SESSION['installData'] ) );
137 - }
138 -
139 - $please = $installerStarted
140 - ? "Please <a href=\"$path/mw-config/index.$ext\"> complete the installation</a> and download LocalSettings.php."
141 - : "Please <a href=\"$path/mw-config/index.$ext\"> set up the wiki</a> first.";
142 -
143 - wfDie( "<p>LocalSettings.php not found.</p><p>$please</p>" );
 124+ require_once( "$IP/includes/templates/NoLocalSettings.php" );
 125+ die();
144126 }
145127
146128 # Include site settings. $IP may be changed (hopefully before the AutoLoader is invoked)
Property changes on: branches/REL1_18/phase3/includes/WebStart.php
___________________________________________________________________
Added: svn:mergeinfo
147129 Merged /branches/new-installer/phase3/includes/WebStart.php:r43664-66004
148130 Merged /branches/wmf-deployment/includes/WebStart.php:r53381
149131 Merged /branches/REL1_15/phase3/includes/WebStart.php:r51646
150132 Merged /branches/sqlite/includes/WebStart.php:r58211-58321
151133 Merged /trunk/phase3/includes/WebStart.php:r89624
Index: branches/REL1_18/phase3/includes/templates/NoLocalSettings.php
@@ -0,0 +1,64 @@
 2+<?php
 3+/**
 4+ * Template used when there is no LocalSettings.php file
 5+ *
 6+ * @file
 7+ * @ingroup Templates
 8+ */
 9+
 10+if ( !isset( $wgVersion ) ) {
 11+ $wgVersion = 'VERSION';
 12+}
 13+$script = $_SERVER['SCRIPT_NAME'];
 14+$path = pathinfo( $script, PATHINFO_DIRNAME ) . '/';
 15+$path = str_replace( '//', '/', $path );
 16+$ext = pathinfo( $script, PATHINFO_EXTENSION );
 17+
 18+# Check to see if the installer is running
 19+if ( !function_exists( 'session_name' ) ) {
 20+ $installerStarted = false;
 21+} else {
 22+ session_name( 'mw_installer_session' );
 23+ $oldReporting = error_reporting( E_ALL & ~E_NOTICE );
 24+ $success = session_start();
 25+ error_reporting( $oldReporting );
 26+ $installerStarted = ( $success && isset( $_SESSION['installData'] ) );
 27+}
 28+?>
 29+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 30+<html xmlns='http://www.w3.org/1999/xhtml' lang='en'>
 31+ <head>
 32+ <title>MediaWiki <?php echo htmlspecialchars( $wgVersion ) ?></title>
 33+ <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
 34+ <style type='text/css' media='screen'>
 35+ html, body {
 36+ color: #000;
 37+ background-color: #fff;
 38+ font-family: sans-serif;
 39+ text-align: center;
 40+ }
 41+
 42+ h1 {
 43+ font-size: 150%;
 44+ }
 45+ </style>
 46+ </head>
 47+ <body>
 48+ <img src="<?php echo htmlspecialchars( $path ) ?>skins/common/images/mediawiki.png" alt='The MediaWiki logo' />
 49+
 50+ <h1>MediaWiki <?php echo htmlspecialchars( $wgVersion ) ?></h1>
 51+ <div class='error'>
 52+ <p>LocalSettings.php not found.</p>
 53+ <p>
 54+ <?php
 55+ if ( $installerStarted ) {
 56+ echo( "Please <a href=\"" . htmlspecialchars( $path ) . "mw-config/index." . htmlspecialchars( $ext ) . "\"> complete the installation</a> and download LocalSettings.php." );
 57+ } else {
 58+ echo( "Please <a href=\"" . htmlspecialchars( $path ) . "mw-config/index." . htmlspecialchars( $ext ) . "\"> set up the wiki</a> first." );
 59+ }
 60+ ?>
 61+ </p>
 62+
 63+ </div>
 64+ </body>
 65+</html>
Property changes on: branches/REL1_18/phase3/includes/templates/NoLocalSettings.php
___________________________________________________________________
Added: svn:mergeinfo
166 Merged /branches/REL1_15/phase3/includes/templates/NoLocalSettings.php:r51646
267 Merged /branches/sqlite/includes/templates/NoLocalSettings.php:r58211-58321
368 Merged /branches/new-installer/phase3/includes/templates/NoLocalSettings.php:r43664-66004
469 Merged /branches/wmf-deployment/includes/templates/NoLocalSettings.php:r53381
Added: svn:eol-style
570 + native
Index: branches/REL1_18/phase3/index.php
@@ -165,9 +165,15 @@
166166 $version = isset( $wgVersion ) && $wgVersion
167167 ? htmlspecialchars( $wgVersion )
168168 : '';
 169+
 170+ $script = $_SERVER['SCRIPT_NAME'];
 171+ $path = pathinfo( $script, PATHINFO_DIRNAME ) . '/';
 172+ $path = str_replace( '//', '/', $path );
 173+
169174 $logo = isset( $wgLogo ) && $wgLogo
170175 ? $wgLogo
171 - : 'http://upload.wikimedia.org/wikipedia/commons/1/1c/MediaWiki_logo.png';
 176+ : $path . 'skins/common/images/mediawiki.png';
 177+ $encLogo = htmlspecialchars( $logo );
172178
173179 header( $_SERVER['SERVER_PROTOCOL'] . ' 500 MediaWiki configuration Error', true, 500 );
174180
@@ -195,7 +201,7 @@
196202 </style>
197203 </head>
198204 <body>
199 - <img src="<?php echo $logo; ?>" alt='The MediaWiki logo' />
 205+ <img src="<?php echo $encLogo; ?>" alt='The MediaWiki logo' />
200206 <h1>MediaWiki <?php echo $version; ?> internal error</h1>
201207 <div class='error'> <?php echo $errorMsg; ?> </div>
202208 </body>
Property changes on: branches/REL1_18/phase3/index.php
___________________________________________________________________
Added: svn:mergeinfo
203209 Merged /branches/REL1_18/phase3/index.php:r89624
204210 Merged /branches/sqlite/index.php:r58211-58321
205211 Merged /trunk/phase3/index.php:r87632,87636,87640,87644,89624-89625
206212 Merged /branches/new-installer/phase3/index.php:r43664-66004
207213 Merged /branches/REL1_15/phase3/index.php:r51646
208214 Merged /branches/REL1_17/phase3/index.php:r81445,81448

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r89624* Restored the page shown when LocalSettings.php is missing to how it was bef...tstarling05:11, 7 June 2011
r89625* Fix for r89624: fixed logo HTML escapingtstarling05:22, 7 June 2011

Status & tagging log