Do not support new installations via .php5 entrypoint any longer
authorChad Horohoe <chadh@wikimedia.org>
Tue, 2 Jun 2015 15:38:57 +0000 (08:38 -0700)
committerChad Horohoe <chadh@wikimedia.org>
Tue, 2 Jun 2015 15:38:57 +0000 (08:38 -0700)
Continues the path of deprecating $wgScriptExtension and all of
the related baggage.

You'll only end up with sadness when we rip out of the rest of
this later so don't let people shoot themselves in the foot.

Change-Id: I34cd1d2c266405ebc761a271e3740e972fb7cf2f

docs/scripts.txt
includes/installer/Installer.php
includes/installer/LocalSettingsGenerator.php
includes/installer/WebInstaller.php
includes/installer/WebInstallerPage.php
mw-config/index.php5 [deleted file]

index 178bb15..53dff36 100644 (file)
@@ -49,7 +49,4 @@ Primary scripts:
 
 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 mw-config/index.php5 for installation.
-
+scripts with PHP 4. You should not use them anymore.
index 5ae499d..676efd6 100644 (file)
@@ -146,7 +146,6 @@ abstract class Installer {
         * @var array
         */
        protected $envPreps = array(
-               'envPrepExtension',
                'envPrepServer',
                'envPrepPath',
        );
@@ -177,7 +176,6 @@ abstract class Installer {
                'wgGitBin',
                'IP',
                'wgScriptPath',
-               'wgScriptExtension',
                'wgMetaNamespace',
                'wgDeletedDirectory',
                'wgEnableUploads',
@@ -1227,19 +1225,6 @@ abstract class Installer {
         */
        abstract protected function envGetDefaultServer();
 
-       /**
-        * Environment prep for setting the preferred PHP file extension.
-        */
-       protected function envPrepExtension() {
-               // @todo FIXME: Detect this properly
-               if ( defined( 'MW_INSTALL_PHP5_EXT' ) ) {
-                       $ext = '.php5';
-               } else {
-                       $ext = '.php';
-               }
-               $this->setVar( 'wgScriptExtension', $ext );
-       }
-
        /**
         * Environment prep for setting $IP and $wgScriptPath.
         */
index 162a789..9bf055c 100644 (file)
@@ -57,7 +57,7 @@ class LocalSettingsGenerator {
 
                $confItems = array_merge(
                        array(
-                               'wgServer', 'wgScriptPath', 'wgScriptExtension',
+                               'wgServer', 'wgScriptPath',
                                'wgPasswordSender', 'wgImageMagickConvertCommand', 'wgShellLocale',
                                'wgLanguageCode', 'wgEnableEmail', 'wgEnableUserEmail', 'wgDiff3',
                                'wgEnotifUserTalk', 'wgEnotifWatchlist', 'wgEmailAuthentication',
@@ -331,7 +331,6 @@ if ( !defined( 'MEDIAWIKI' ) ) {
 ## (like /w/index.php/Page_title to /wiki/Page_title) please see:
 ## https://www.mediawiki.org/wiki/Manual:Short_URL
 \$wgScriptPath = \"{$this->values['wgScriptPath']}\";
-\$wgScriptExtension = \"{$this->values['wgScriptExtension']}\";
 ${serverSetting}
 ## The relative URL path to the skins directory
 \$wgStylePath = \"\$wgScriptPath/skins\";
index 156606a..4930826 100644 (file)
@@ -1184,12 +1184,11 @@ class WebInstaller extends Installer {
                }
                if ( $path !== false ) {
                        $scriptPath = preg_replace( '{^(.*)/(mw-)?config.*$}', '$1', $path );
-                       $scriptExtension = $this->getVar( 'wgScriptExtension' );
 
                        $this->setVar( 'wgScriptPath', "$scriptPath" );
                        // Update variables set from Setup.php that are derived from wgScriptPath
-                       $this->setVar( 'wgScript', "$scriptPath/index$scriptExtension" );
-                       $this->setVar( 'wgLoadScript', "$scriptPath/load$scriptExtension" );
+                       $this->setVar( 'wgScript', "$scriptPath/index.php" );
+                       $this->setVar( 'wgLoadScript', "$scriptPath/load.php" );
                        $this->setVar( 'wgStylePath', "$scriptPath/skins" );
                        $this->setVar( 'wgLocalStylePath', "$scriptPath/skins" );
                        $this->setVar( 'wgExtensionAssetsPath', "$scriptPath/extensions" );
index 98f3ae8..f40de71 100644 (file)
@@ -669,6 +669,8 @@ class WebInstallerUpgrade extends WebInstallerPage {
        }
 
        public function showDoneMessage() {
+               global $wgScriptExtension;
+
                $this->startForm();
                $regenerate = !$this->getVar( '_ExistingDBSettings' );
                if ( $regenerate ) {
@@ -682,7 +684,7 @@ class WebInstallerUpgrade extends WebInstallerPage {
                                wfMessage( $msg,
                                        $this->getVar( 'wgServer' ) .
                                        $this->getVar( 'wgScriptPath' ) . '/index' .
-                                       $this->getVar( 'wgScriptExtension' )
+                                       $wgScriptExtension
                                )->plain(), 'tick-32.png'
                        )
                );
@@ -1479,8 +1481,7 @@ class WebInstallerComplete extends WebInstallerPage {
                                wfMessage( 'config-install-done',
                                        $lsUrl,
                                        $this->getVar( 'wgServer' ) .
-                                       $this->getVar( 'wgScriptPath' ) . '/index' .
-                                       $this->getVar( 'wgScriptExtension' ),
+                                       $this->getVar( 'wgScriptPath' ) . '/index.php',
                                        '<downloadlink/>'
                                )->plain(), 'tick-32.png'
                        )
diff --git a/mw-config/index.php5 b/mw-config/index.php5
deleted file mode 100644 (file)
index 8898653..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-/**
- * Version of mw-config/index.php to be used in web servers that require the .php5
- * extension to execute scripts with the PHP5 engine.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- */
-
-define( 'MW_INSTALL_PHP5_EXT', 1 );
-
-require './index.php';