(bug 1379) Installer directory conflicts with some hosts' configuration panel.
authorMax Semenik <maxsem@users.mediawiki.org>
Sat, 26 Feb 2011 12:35:23 +0000 (12:35 +0000)
committerMax Semenik <maxsem@users.mediawiki.org>
Sat, 26 Feb 2011 12:35:23 +0000 (12:35 +0000)
Renamed config/ to mw-config/, however left aliases for b/c.

14 files changed:
HISTORY
INSTALL
config/OBSOLETE [new file with mode: 0644]
config/index.php
config/index.php5
docs/distributors.txt
docs/scripts.txt
includes/WebStart.php
includes/installer/Installer.php
includes/installer/WebInstaller.php
includes/templates/NoLocalSettings.php
includes/templates/PHP4.php
mw-config/index.php [new file with mode: 0644]
mw-config/index.php5 [new file with mode: 0644]

diff --git a/HISTORY b/HISTORY
index dd0870a..3959ed5 100644 (file)
--- a/HISTORY
+++ b/HISTORY
@@ -451,6 +451,7 @@ LocalSettings.php. The specific bugs are listed below in the general notes.
 * (bug 18372) $wgFileExtensions will now override $wgFileBlacklist 
 * (bug 25512) Subcategory list should not include category prefix for members.
 * (bug 20244) Installer does not validate SQLite database directory for stable path
+* (bug 1379) Installer directory conflicts with some hosts' configuration panel.
 
 === API changes in 1.17 ===
 * (bug 22738) Allow filtering by action type on query=logevent.
diff --git a/INSTALL b/INSTALL
index 33cc595..ec0b7bb 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -65,7 +65,7 @@ available to download from the installer. Download this now, there is not a
 way (yet) to get it after you exit the installer. Place it in the main wiki
 directory, and the wiki should now be working.
 
-Once the wiki is set up, you should remove the config directory (though it will
+Once the wiki is set up, you should remove the mw-config directory (though it will
 refuse to config again if the wiki is set up).
 
 ----
diff --git a/config/OBSOLETE b/config/OBSOLETE
new file mode 100644 (file)
index 0000000..108c167
--- /dev/null
@@ -0,0 +1,2 @@
+This is a back-compat directory for installer, which resides in mw-config/ now.\r
+It will probably be remved in 1.19.
\ No newline at end of file
index c00a0d0..948fe69 100644 (file)
@@ -1,50 +1 @@
-<?php
-/**
- * New version of MediaWiki web-based config/installation
- *
- * @file
- */
-
-define( 'MW_CONFIG_CALLBACK', 'Installer::overrideConfig' );
-define( 'MEDIAWIKI_INSTALL', true );
-
-chdir( dirname( dirname( __FILE__ ) ) );
-require( dirname( dirname( __FILE__ ) ) . '/includes/WebStart.php' );
-
-wfInstallerMain();
-
-function wfInstallerMain() {
-       global $wgRequest, $wgLang, $wgMetaNamespace, $wgCanonicalNamespaceNames;
-
-       $installer = new WebInstaller( $wgRequest );
-
-       if ( !$installer->startSession() ) {
-               $installer->finish();
-               exit;
-       }
-
-       $fingerprint = $installer->getFingerprint();
-       if ( isset( $_SESSION['installData'][$fingerprint] ) ) {
-               $session = $_SESSION['installData'][$fingerprint];
-       } else {
-               $session = array();
-       }
-
-       if ( isset( $session['settings']['_UserLang'] ) ) {
-               $langCode = $session['settings']['_UserLang'];
-       } elseif ( !is_null( $wgRequest->getVal( 'UserLang' ) ) ) {
-               $langCode = $wgRequest->getVal( 'UserLang' );
-       } else {
-               $langCode = 'en';
-       }
-       $wgLang = Language::factory( $langCode );
-
-       $installer->setParserLanguage( $wgLang );
-
-       $wgMetaNamespace = $wgCanonicalNamespaceNames[NS_PROJECT];
-
-       $session = $installer->execute( $session );
-
-       $_SESSION['installData'][$fingerprint] = $session;
-
-}
+<?php require( dirname( dirname( __FILE__ ) ) . '/mw-config/index.php' );
\ No newline at end of file
index 8e6ceda..f9ce630 100644 (file)
@@ -1,4 +1 @@
-<?php
-
-define('MW_INSTALL_PHP5_EXT', 1);
-require './index.php';
+<?php require( dirname( dirname( __FILE__ ) ) . '/mw-config/index.php5' );
\ No newline at end of file
index 2a953a5..b636c12 100644 (file)
@@ -61,7 +61,7 @@ correctly:
   * api.php, img_auth.php, index.php,opensearch_desc.php, profileinfo.php,
   redirect.php, thumb.php, trackback.php.  These are the entry points for
   normal usage.  This list may be incomplete and is subject to change.
-  * config/index.php: Used for web-based installation (sets up the database,
+  * mw-config/index.php: Used for web-based installation (sets up the database,
   prompts for the name of the wiki, etc.).  No command-line installation is
   currently available.
   * images/: Used for uploaded files.  This could be somewhere else if
@@ -83,13 +83,13 @@ something.  You have been warned.
 == Configuration ==
 
 MediaWiki is configured using LocalSettings.php.  This is a PHP file that's
-generated when the user visits config/index.php to install the software, and
+generated when the user visits mw-config/index.php to install the software, and
 which the user can edit by hand thereafter.  It's just a plain old PHP file,
 and can contain any PHP statements.  It usually sets global variables that are
 used for configuration, and includes files used by any extensions.
 
 Distributors cannot easily add extra statements to the autogenerated
-LocalSettings.php at the present time -- although hacking config/index.php
+LocalSettings.php at the present time -- although hacking mw-config/index.php
 would work.  It would be nice if this situation could be improved.
 
 Some configuration options that distributors might be in a position to set
index d250f80..4af2a2b 100644 (file)
@@ -61,5 +61,5 @@ There is also a file with a .php5 extension for each script. They can be used if
 the web server needs a .php5 to run the file with the PHP 5 engine and runs .php
 scripts with PHP 4. To use these files, you have to modify $wgScriptExtension to
 '.php5' is LocalSettings.php but it is already done by the config script if you
-used config/index.php5 for installation.
+used mw-config/index.php5 for installation.
 
index 770e81f..b212397 100644 (file)
@@ -104,7 +104,7 @@ if ( defined( 'MW_CONFIG_CALLBACK' ) ) {
        
        # LocalSettings.php is the per site customization file. If it does not exist
        # the wiki installer needs to be launched or the generated file moved from
-       # ./config/ to ./
+       # ./mw-config/ to ./
        if( !file_exists( MW_CONFIG_FILE ) ) {
                require_once( "$IP/includes/templates/NoLocalSettings.php" );
                die();
index 9c2a8f4..af21572 100644 (file)
@@ -485,7 +485,7 @@ abstract class Installer {
         * On POSIX systems return the primary group of the webserver we're running under.
         * On other systems just returns null.
         *
-        * This is used to advice the user that he should chgrp his config/data/images directory as the
+        * This is used to advice the user that he should chgrp his mw-config/data/images directory as the
         * webserver user before he can install.
         *
         * Public because SqliteInstaller needs it, and doesn't subclass Installer.
index a40d14c..8405a62 100644 (file)
@@ -316,7 +316,7 @@ class WebInstaller extends Installer {
        /**
         * Get a hash of data identifying this MW installation.
         *
-        * This is used by config/index.php to prevent multiple installations of MW
+        * This is used by mw-config/index.php to prevent multiple installations of MW
         * on the same cookie domain from interfering with each other.
         */
        public function getFingerprint() {
index d31b226..9001e3b 100644 (file)
@@ -52,9 +52,9 @@ if ( !function_exists( 'session_name' ) ) {
                <p>
                <?php
                if ( $installerStarted ) {
-                       echo( "Please <a href=\"" . htmlspecialchars( $path ) . "config/index." . htmlspecialchars( $ext ) . "\"> complete the installation</a> and download LocalSettings.php." );
+                       echo( "Please <a href=\"" . htmlspecialchars( $path ) . "mw-config/index." . htmlspecialchars( $ext ) . "\"> complete the installation</a> and download LocalSettings.php." );
                } else {
-                       echo( "Please <a href=\"" . htmlspecialchars( $path ) . "config/index." . htmlspecialchars( $ext ) . "\"> set up the wiki</a> first." );
+                       echo( "Please <a href=\"" . htmlspecialchars( $path ) . "mw-config/index." . htmlspecialchars( $ext ) . "\"> set up the wiki</a> first." );
                }
                ?>
                </p>
index 511ce71..69f7d55 100644 (file)
@@ -19,7 +19,7 @@ if( isset( $_SERVER['SCRIPT_NAME'] ) ) {
 } else {
        $scriptUrl = '';
 }
-if ( preg_match( '!^(.*)/config/[^/]*.php$!', $scriptUrl, $m ) ) {
+if ( preg_match( '!^(.*)/(mw-)?config/[^/]*.php$!', $scriptUrl, $m ) ) {
        $baseUrl = $m[1];
 } elseif ( preg_match( '!^(.*)/[^/]*.php$!', $scriptUrl, $m ) ) {
        $baseUrl = $m[1];
diff --git a/mw-config/index.php b/mw-config/index.php
new file mode 100644 (file)
index 0000000..c00a0d0
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+/**
+ * New version of MediaWiki web-based config/installation
+ *
+ * @file
+ */
+
+define( 'MW_CONFIG_CALLBACK', 'Installer::overrideConfig' );
+define( 'MEDIAWIKI_INSTALL', true );
+
+chdir( dirname( dirname( __FILE__ ) ) );
+require( dirname( dirname( __FILE__ ) ) . '/includes/WebStart.php' );
+
+wfInstallerMain();
+
+function wfInstallerMain() {
+       global $wgRequest, $wgLang, $wgMetaNamespace, $wgCanonicalNamespaceNames;
+
+       $installer = new WebInstaller( $wgRequest );
+
+       if ( !$installer->startSession() ) {
+               $installer->finish();
+               exit;
+       }
+
+       $fingerprint = $installer->getFingerprint();
+       if ( isset( $_SESSION['installData'][$fingerprint] ) ) {
+               $session = $_SESSION['installData'][$fingerprint];
+       } else {
+               $session = array();
+       }
+
+       if ( isset( $session['settings']['_UserLang'] ) ) {
+               $langCode = $session['settings']['_UserLang'];
+       } elseif ( !is_null( $wgRequest->getVal( 'UserLang' ) ) ) {
+               $langCode = $wgRequest->getVal( 'UserLang' );
+       } else {
+               $langCode = 'en';
+       }
+       $wgLang = Language::factory( $langCode );
+
+       $installer->setParserLanguage( $wgLang );
+
+       $wgMetaNamespace = $wgCanonicalNamespaceNames[NS_PROJECT];
+
+       $session = $installer->execute( $session );
+
+       $_SESSION['installData'][$fingerprint] = $session;
+
+}
diff --git a/mw-config/index.php5 b/mw-config/index.php5
new file mode 100644 (file)
index 0000000..8e6ceda
--- /dev/null
@@ -0,0 +1,4 @@
+<?php
+
+define('MW_INSTALL_PHP5_EXT', 1);
+require './index.php';