r82850 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82849‎ | r82850 | r82851 >
Date:13:15, 26 February 2011
Author:maxsem
Status:ok
Tags:
Comment:
1.17 MFT r82845, r82847, r82848 and r82849 (config/ --> mw-config/)
Modified paths:
  • /branches/REL1_17/phase3 (modified) (history)
  • /branches/REL1_17/phase3/INSTALL (modified) (history)
  • /branches/REL1_17/phase3/RELEASE-NOTES (modified) (history)
  • /branches/REL1_17/phase3/config (replaced) (history)
  • /branches/REL1_17/phase3/config/index.php (replaced) (history)
  • /branches/REL1_17/phase3/config/index.php5 (replaced) (history)
  • /branches/REL1_17/phase3/docs/distributors.txt (modified) (history)
  • /branches/REL1_17/phase3/docs/scripts.txt (modified) (history)
  • /branches/REL1_17/phase3/includes (modified) (history)
  • /branches/REL1_17/phase3/includes/WebStart.php (modified) (history)
  • /branches/REL1_17/phase3/includes/installer/Installer.php (modified) (history)
  • /branches/REL1_17/phase3/includes/installer/WebInstaller.php (modified) (history)
  • /branches/REL1_17/phase3/includes/templates/NoLocalSettings.php (modified) (history)
  • /branches/REL1_17/phase3/includes/templates/PHP4.php (modified) (history)
  • /branches/REL1_17/phase3/mw-config (added) (history)

Diff [purge]

Index: branches/REL1_17/phase3/docs/scripts.txt
@@ -61,5 +61,5 @@
6262 the web server needs a .php5 to run the file with the PHP 5 engine and runs .php
6363 scripts with PHP 4. To use these files, you have to modify $wgScriptExtension to
6464 '.php5' is LocalSettings.php but it is already done by the config script if you
65 -used config/index.php5 for installation.
 65+used mw-config/index.php5 for installation.
6666
Index: branches/REL1_17/phase3/docs/distributors.txt
@@ -61,7 +61,7 @@
6262 * api.php, img_auth.php, index.php,opensearch_desc.php, profileinfo.php,
6363 redirect.php, thumb.php, trackback.php. These are the entry points for
6464 normal usage. This list may be incomplete and is subject to change.
65 - * config/index.php: Used for web-based installation (sets up the database,
 65+ * mw-config/index.php: Used for web-based installation (sets up the database,
6666 prompts for the name of the wiki, etc.). No command-line installation is
6767 currently available.
6868 * images/: Used for uploaded files. This could be somewhere else if
@@ -83,13 +83,13 @@
8484 == Configuration ==
8585
8686 MediaWiki is configured using LocalSettings.php. This is a PHP file that's
87 -generated when the user visits config/index.php to install the software, and
 87+generated when the user visits mw-config/index.php to install the software, and
8888 which the user can edit by hand thereafter. It's just a plain old PHP file,
8989 and can contain any PHP statements. It usually sets global variables that are
9090 used for configuration, and includes files used by any extensions.
9191
9292 Distributors cannot easily add extra statements to the autogenerated
93 -LocalSettings.php at the present time -- although hacking config/index.php
 93+LocalSettings.php at the present time -- although hacking mw-config/index.php
9494 would work. It would be nice if this situation could be improved.
9595
9696 Some configuration options that distributors might be in a position to set
Index: branches/REL1_17/phase3/includes/installer/WebInstaller.php
@@ -298,7 +298,7 @@
299299 /**
300300 * Get a hash of data identifying this MW installation.
301301 *
302 - * This is used by config/index.php to prevent multiple installations of MW
 302+ * This is used by mw-config/index.php to prevent multiple installations of MW
303303 * on the same cookie domain from interfering with each other.
304304 */
305305 public function getFingerprint() {
Index: branches/REL1_17/phase3/includes/installer/Installer.php
@@ -487,7 +487,7 @@
488488 * On POSIX systems return the primary group of the webserver we're running under.
489489 * On other systems just returns null.
490490 *
491 - * This is used to advice the user that he should chgrp his config/data/images directory as the
 491+ * This is used to advice the user that he should chgrp his mw-config/data/images directory as the
492492 * webserver user before he can install.
493493 *
494494 * Public because SqliteInstaller needs it, and doesn't subclass Installer.
@@ -838,7 +838,7 @@
839839 return false;
840840 }
841841
842 - $uri = preg_replace( '{^(.*)/config.*$}', '$1', $path );
 842+ $uri = preg_replace( '{^(.*)/(mw-)?config.*$}', '$1', $path );
843843 $this->setVar( 'wgScriptPath', $uri );
844844 }
845845
Index: branches/REL1_17/phase3/includes/WebStart.php
@@ -107,8 +107,8 @@
108108 define('MW_CONFIG_FILE', "$IP/LocalSettings.php");
109109
110110 # LocalSettings.php is the per site customization file. If it does not exist
111 - # the wiki installer needs to be launched or the generated file moved from
112 - # ./config/ to ./
 111+ # the wiki installer needs to be launched or the generated file uploaded to
 112+ # the root wiki directory
113113 if( !file_exists( MW_CONFIG_FILE ) ) {
114114 require_once( "$IP/includes/templates/NoLocalSettings.php" );
115115 die();
Index: branches/REL1_17/phase3/includes/templates/PHP4.php
@@ -19,7 +19,7 @@
2020 } else {
2121 $scriptUrl = '';
2222 }
23 -if ( preg_match( '!^(.*)/config/[^/]*.php$!', $scriptUrl, $m ) ) {
 23+if ( preg_match( '!^(.*)/(mw-)?config/[^/]*.php$!', $scriptUrl, $m ) ) {
2424 $baseUrl = $m[1];
2525 } elseif ( preg_match( '!^(.*)/[^/]*.php$!', $scriptUrl, $m ) ) {
2626 $baseUrl = $m[1];
Index: branches/REL1_17/phase3/includes/templates/NoLocalSettings.php
@@ -52,9 +52,9 @@
5353 <p>
5454 <?php
5555 if ( $installerStarted ) {
56 - echo( "Please <a href=\"" . htmlspecialchars( $path ) . "config/index." . htmlspecialchars( $ext ) . "\"> complete the installation</a> and download LocalSettings.php." );
 56+ echo( "Please <a href=\"" . htmlspecialchars( $path ) . "mw-config/index." . htmlspecialchars( $ext ) . "\"> complete the installation</a> and download LocalSettings.php." );
5757 } else {
58 - echo( "Please <a href=\"" . htmlspecialchars( $path ) . "config/index." . htmlspecialchars( $ext ) . "\"> set up the wiki</a> first." );
 58+ echo( "Please <a href=\"" . htmlspecialchars( $path ) . "mw-config/index." . htmlspecialchars( $ext ) . "\"> set up the wiki</a> first." );
5959 }
6060 ?>
6161 </p>
Property changes on: branches/REL1_17/phase3/includes
___________________________________________________________________
Modified: svn:mergeinfo
6262 Merged /trunk/phase3/includes:r82845,82847-82848
Index: branches/REL1_17/phase3/INSTALL
@@ -65,7 +65,7 @@
6666 way (yet) to get it after you exit the installer. Place it in the main wiki
6767 directory, and the wiki should now be working.
6868
69 -Once the wiki is set up, you should remove the config directory (though it will
 69+Once the wiki is set up, you should remove the mw-config directory (though it will
7070 refuse to config again if the wiki is set up).
7171
7272 ----
Index: branches/REL1_17/phase3/mw-config/index.php5
@@ -0,0 +1,4 @@
 2+<?php
 3+
 4+define('MW_INSTALL_PHP5_EXT', 1);
 5+require './index.php';
Property changes on: branches/REL1_17/phase3/mw-config/index.php5
___________________________________________________________________
Added: svn:eol-style
16 + native
Index: branches/REL1_17/phase3/mw-config/index.php
@@ -0,0 +1,50 @@
 2+<?php
 3+/**
 4+ * New version of MediaWiki web-based config/installation
 5+ *
 6+ * @file
 7+ */
 8+
 9+define( 'MW_CONFIG_CALLBACK', 'Installer::overrideConfig' );
 10+define( 'MEDIAWIKI_INSTALL', true );
 11+
 12+chdir( dirname( dirname( __FILE__ ) ) );
 13+require( dirname( dirname( __FILE__ ) ) . '/includes/WebStart.php' );
 14+
 15+wfInstallerMain();
 16+
 17+function wfInstallerMain() {
 18+ global $wgRequest, $wgLang, $wgMetaNamespace, $wgCanonicalNamespaceNames;
 19+
 20+ $installer = new WebInstaller( $wgRequest );
 21+
 22+ if ( !$installer->startSession() ) {
 23+ $installer->finish();
 24+ exit;
 25+ }
 26+
 27+ $fingerprint = $installer->getFingerprint();
 28+ if ( isset( $_SESSION['installData'][$fingerprint] ) ) {
 29+ $session = $_SESSION['installData'][$fingerprint];
 30+ } else {
 31+ $session = array();
 32+ }
 33+
 34+ if ( isset( $session['settings']['_UserLang'] ) ) {
 35+ $langCode = $session['settings']['_UserLang'];
 36+ } elseif ( !is_null( $wgRequest->getVal( 'UserLang' ) ) ) {
 37+ $langCode = $wgRequest->getVal( 'UserLang' );
 38+ } else {
 39+ $langCode = 'en';
 40+ }
 41+ $wgLang = Language::factory( $langCode );
 42+
 43+ $installer->setParserLanguage( $wgLang );
 44+
 45+ $wgMetaNamespace = $wgCanonicalNamespaceNames[NS_PROJECT];
 46+
 47+ $session = $installer->execute( $session );
 48+
 49+ $_SESSION['installData'][$fingerprint] = $session;
 50+
 51+}
Property changes on: branches/REL1_17/phase3/mw-config/index.php
___________________________________________________________________
Added: svn:eol-style
152 + native
Property changes on: branches/REL1_17/phase3/mw-config
___________________________________________________________________
Added: svn:ignore
253 + LocalSettings.php
Index: branches/REL1_17/phase3/config/index.php5
@@ -1,4 +1 @@
2 -<?php
3 -
4 -define('MW_INSTALL_PHP5_EXT', 1);
5 -require './index.php';
 2+<?php require( dirname( dirname( __FILE__ ) ) . '/mw-config/index.php5' );
\ No newline at end of file
Property changes on: branches/REL1_17/phase3/config/index.php5
___________________________________________________________________
Deleted: svn:eol-style
63 - native
Index: branches/REL1_17/phase3/config/OBSOLETE
@@ -0,0 +1,2 @@
 2+This is a back-compat directory for installer, which resides in mw-config/ now.
 3+It will probably be remved in 1.19.
\ No newline at end of file
Index: branches/REL1_17/phase3/config/index.php
@@ -1,50 +1 @@
2 -<?php
3 -/**
4 - * New version of MediaWiki web-based config/installation
5 - *
6 - * @file
7 - */
8 -
9 -define( 'MW_CONFIG_CALLBACK', 'Installer::overrideConfig' );
10 -define( 'MEDIAWIKI_INSTALL', true );
11 -
12 -chdir( ".." );
13 -require( './includes/WebStart.php' );
14 -
15 -wfInstallerMain();
16 -
17 -function wfInstallerMain() {
18 - global $wgRequest, $wgLang, $wgMetaNamespace, $wgCanonicalNamespaceNames;
19 -
20 - $installer = new WebInstaller( $wgRequest );
21 -
22 - if ( !$installer->startSession() ) {
23 - $installer->finish();
24 - exit;
25 - }
26 -
27 - $fingerprint = $installer->getFingerprint();
28 - if ( isset( $_SESSION['installData'][$fingerprint] ) ) {
29 - $session = $_SESSION['installData'][$fingerprint];
30 - } else {
31 - $session = array();
32 - }
33 -
34 - if ( isset( $session['settings']['_UserLang'] ) ) {
35 - $langCode = $session['settings']['_UserLang'];
36 - } elseif ( !is_null( $wgRequest->getVal( 'UserLang' ) ) ) {
37 - $langCode = $wgRequest->getVal( 'UserLang' );
38 - } else {
39 - $langCode = 'en';
40 - }
41 - $wgLang = Language::factory( $langCode );
42 -
43 - $installer->setParserLanguage( $wgLang );
44 -
45 - $wgMetaNamespace = $wgCanonicalNamespaceNames[NS_PROJECT];
46 -
47 - $session = $installer->execute( $session );
48 -
49 - $_SESSION['installData'][$fingerprint] = $session;
50 -
51 -}
 2+<?php require( dirname( dirname( __FILE__ ) ) . '/mw-config/index.php' );
\ No newline at end of file
Property changes on: branches/REL1_17/phase3/config
___________________________________________________________________
Deleted: svn:ignore
523 - LocalSettings.php
Index: branches/REL1_17/phase3/RELEASE-NOTES
@@ -22,7 +22,9 @@
2323 MediaWiki 1.17 is shipping with a completely redesigned installer to fix
2424 a lot of outstanding bugs, cleanup the code quality, and make it easier to
2525 use. Notably, you can now run upgrades from the web without having to move
26 -LocalSettings.php. The specific bugs are listed below in the general notes.
 26+LocalSettings.php. Also, configuration script directory has been renamed
 27+from config/ to mw-config/. The specific bugs are listed below in the
 28+general notes.
2729
2830 === New ResourceLoader in 1.17 ===
2931 MediaWiki 1.17 ships with a ResourceLoader which combines and minifies css and
@@ -493,6 +495,7 @@
494496 * (bug 26208) Mark directionality of some interlanguage links
495497 * (bug 26716) Provide link to instructions for external editor related preferences.
496498 * (bug 26961) Hide anon edits in watchlist preference now actually works.
 499+* (bug 1379) Installer directory conflicts with some hosts' configuration panel.
497500
498501 === API changes in 1.17 ===
499502 * BREAKING CHANGE: action=patrol now requires POST
Property changes on: branches/REL1_17/phase3/RELEASE-NOTES
___________________________________________________________________
Modified: svn:mergeinfo
500503 Merged /trunk/phase3/RELEASE-NOTES:r82845,82847-82848
Property changes on: branches/REL1_17/phase3
___________________________________________________________________
Modified: svn:mergeinfo
501504 Merged /trunk/phase3:r82845,82847-82849

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r82845(bug 1379) Installer directory conflicts with some hosts' configuration panel....maxsem12:35, 26 February 2011
r82847Follow-up r82845: fix $wgScriptPath detection.maxsem12:51, 26 February 2011
r82848Tweak comment, we don't create LS in the conf dir anymore, you have to upload itdemon12:56, 26 February 2011
r82849More prominent mention of r82845maxsem13:07, 26 February 2011

Status & tagging log