Remove $wgScriptExtension (deprecated and ignored since 1.25)
authorJames D. Forrester <jforrester@wikimedia.org>
Fri, 16 Feb 2018 22:03:44 +0000 (14:03 -0800)
committerJforrester <jforrester@wikimedia.org>
Thu, 19 Apr 2018 00:26:26 +0000 (00:26 +0000)
* Remove left-over mention of the .php5 entry points in docs.

* Remove dead logic in NoLocalSettings for php5 entry points.

* Remove dead match in WebRequest for php5 entry points (they'd
  redirect since 1.25, and not seen by PHP).

Change-Id: Ia0ee8588591860b8fe34030c8503f38e9bce31f3
(cherry picked from commit de6dab71e3ea0166095b6c6e3837255d1e56b887)

RELEASE-NOTES-1.31
docs/scripts.txt
includes/DefaultSettings.php
includes/NoLocalSettings.php
includes/Setup.php
includes/WebRequest.php
includes/filerepo/FileRepo.php
includes/resourceloader/ResourceLoaderStartUpModule.php
includes/templates/NoLocalSettings.mustache
tests/phpunit/ResourceLoaderTestCase.php

index b7c4c54..97b8f43 100644 (file)
@@ -37,6 +37,8 @@ production.
   set $wgTidyConfig to null and also set $wgUseTidy to true.
 * $wgLogAutopatrol now defaults to false instead of true.
 * $wgValidateAllHtml was removed and will be ignored.
+* $wgScriptExtension was removed (deprecated and ignored since 1.25).
+  See 1.25 release notes for more information.
 
 === New features in 1.31 ===
 * (T76554) User sub-pages named ….json are now protected in the same way that ….js
index 53dff36..dff428c 100644 (file)
@@ -39,14 +39,10 @@ Primary scripts:
     maintenance/archives/patch-profiling.sql patch to the database.
 
     To enable the profileinfo.php itself, you'll need to set $wgDBadminuser
-    and $wgDBadminpassword in your LocalSettings.php, as well as $wgEnableProfileInfo 
+    and $wgDBadminpassword in your LocalSettings.php, as well as $wgEnableProfileInfo
     See also https://www.mediawiki.org/wiki/Manual:Profiling .
 
   thumb.php
     Script used to resize images if it is configured to be done when the web
     browser requests the image and not when generating the page. This script can
     be used as a 404 handler to generate image thumbs when they don't exist.
-
-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. You should not use them anymore.
index 3f633a3..9922410 100644 (file)
@@ -157,19 +157,6 @@ $wgUsePathInfo = ( strpos( PHP_SAPI, 'cgi' ) === false ) &&
        ( strpos( PHP_SAPI, 'apache2filter' ) === false ) &&
        ( strpos( PHP_SAPI, 'isapi' ) === false );
 
-/**
- * The extension to append to script names by default.
- *
- * Some hosting providers used PHP 4 for *.php files, and PHP 5 for *.php5.
- * This variable was provided to support those providers.
- *
- * @since 1.11
- * @deprecated since 1.25; support for '.php5' has been phased out of MediaWiki
- *  proper. Backward-compatibility can be maintained by configuring your web
- *  server to rewrite URLs. See RELEASE-NOTES for details.
- */
-$wgScriptExtension = '.php';
-
 /**@}*/
 
 /************************************************************************//**
@@ -503,9 +490,6 @@ $wgImgAuthUrlPathMap = [];
  *   - descBaseUrl       URL of image description pages, e.g. https://en.wikipedia.org/wiki/File:
  *   - scriptDirUrl      URL of the MediaWiki installation, equivalent to $wgScriptPath, e.g.
  *                       https://en.wikipedia.org/w
- *   - scriptExtension   Script extension of the MediaWiki installation, equivalent to
- *                       $wgScriptExtension, e.g. ".php5". Defaults to ".php".
- *
  *   - articleUrl        Equivalent to $wgArticlePath, e.g. https://en.wikipedia.org/wiki/$1
  *   - fetchDescription  Fetch the text of the remote file description page. Equivalent to
  *                       $wgFetchCommonsDescriptions.
@@ -8251,7 +8235,7 @@ $wgMaxShellWallClockTime = 180;
 $wgShellCgroup = false;
 
 /**
- * Executable path of the PHP cli binary (php/php5). Should be set up on install.
+ * Executable path of the PHP cli binary. Should be set up on install.
  */
 $wgPhpCli = '/usr/bin/php';
 
index b8bfd6a..46e9630 100644 (file)
 
 # T32219 : can not use pathinfo() on URLs since slashes do not match
 $matches = [];
-$ext = 'php';
 $path = '/';
 foreach ( array_filter( explode( '/', $_SERVER['PHP_SELF'] ) ) as $part ) {
-       if ( !preg_match( '/\.(php5?)$/', $part, $matches ) ) {
+       if ( !preg_match( '/\.(php)$/', $part, $matches ) ) {
                $path .= "$part/";
        } else {
-               $ext = $matches[1] == 'php5' ? 'php5' : 'php';
                break;
        }
 }
@@ -56,7 +54,6 @@ try {
                [
                        'wgVersion' => ( isset( $wgVersion ) ? $wgVersion : 'VERSION' ),
                        'path' => $path,
-                       'ext' => $ext,
                        'localSettingsExists' => file_exists( MW_CONFIG_FILE ),
                        'installerStarted' => $installerStarted
                ]
index cc6915a..f402594 100644 (file)
@@ -280,7 +280,6 @@ if ( !$wgLocalFileRepo ) {
                'name' => 'local',
                'directory' => $wgUploadDirectory,
                'scriptDirUrl' => $wgScriptPath,
-               'scriptExtension' => '.php',
                'url' => $wgUploadBaseUrl ? $wgUploadBaseUrl . $wgUploadPath : $wgUploadPath,
                'hashLevels' => $wgHashedUploadDirectory ? 2 : 0,
                'thumbScriptUrl' => $wgThumbnailScriptPath,
index fa8f84d..c6ddf81 100644 (file)
@@ -141,7 +141,7 @@ class WebRequest {
                                $router->add( "$wgScript/$1" );
 
                                if ( isset( $_SERVER['SCRIPT_NAME'] )
-                                       && preg_match( '/\.php5?/', $_SERVER['SCRIPT_NAME'] )
+                                       && preg_match( '/\.php/', $_SERVER['SCRIPT_NAME'] )
                                ) {
                                        # Check for SCRIPT_NAME, we handle index.php explicitly
                                        # But we do have some other .php files such as img_auth.php
index e430bc8..a67e3d6 100644 (file)
@@ -78,10 +78,6 @@ class FileRepo {
         */
        protected $scriptDirUrl;
 
-       /** @var string Script extension of the MediaWiki installation, equivalent
-        *    to the old $wgScriptExtension, e.g. .php5 defaults to .php */
-       protected $scriptExtension;
-
        /** @var string Equivalent to $wgArticlePath, e.g. https://en.wikipedia.org/wiki/$1 */
        protected $articleUrl;
 
@@ -166,7 +162,7 @@ class FileRepo {
                $optionalSettings = [
                        'descBaseUrl', 'scriptDirUrl', 'articleUrl', 'fetchDescription',
                        'thumbScriptUrl', 'pathDisclosureProtection', 'descriptionCacheExpiry',
-                       'scriptExtension', 'favicon', 'thumbProxyUrl', 'thumbProxySecret'
+                       'favicon', 'thumbProxyUrl', 'thumbProxySecret',
                ];
                foreach ( $optionalSettings as $var ) {
                        if ( isset( $info[$var] ) ) {
@@ -744,9 +740,7 @@ class FileRepo {
         */
        public function makeUrl( $query = '', $entry = 'index' ) {
                if ( isset( $this->scriptDirUrl ) ) {
-                       $ext = isset( $this->scriptExtension ) ? $this->scriptExtension : '.php';
-
-                       return wfAppendQuery( "{$this->scriptDirUrl}/{$entry}{$ext}", $query );
+                       return wfAppendQuery( "{$this->scriptDirUrl}/{$entry}.php", $query );
                }
 
                return false;
@@ -1928,7 +1922,7 @@ class FileRepo {
 
                $optionalSettings = [
                        'url', 'thumbUrl', 'initialCapital', 'descBaseUrl', 'scriptDirUrl', 'articleUrl',
-                       'fetchDescription', 'descriptionCacheExpiry', 'scriptExtension', 'favicon'
+                       'fetchDescription', 'descriptionCacheExpiry', 'favicon'
                ];
                foreach ( $optionalSettings as $k ) {
                        if ( isset( $this->$k ) ) {
index 681e8dc..56d8835 100644 (file)
@@ -88,7 +88,6 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule {
                        'wgUrlProtocols' => wfUrlProtocols(),
                        'wgArticlePath' => $conf->get( 'ArticlePath' ),
                        'wgScriptPath' => $conf->get( 'ScriptPath' ),
-                       'wgScriptExtension' => '.php',
                        'wgScript' => wfScript(),
                        'wgSearchType' => $conf->get( 'SearchType' ),
                        'wgVariantArticlePath' => $conf->get( 'VariantArticlePath' ),
index 5457949..36391f5 100644 (file)
                {{^localSettingsExists}}
                        <p>LocalSettings.php not found.</p>
                        {{#installerStarted}}
-                               <p>Please <a href="{{path}}mw-config/index.{{ext}}">complete the installation</a> and download LocalSettings.php.</p>
+                               <p>Please <a href="{{path}}mw-config/index.php">complete the installation</a> and download LocalSettings.php.</p>
                        {{/installerStarted}}
                        {{^installerStarted}}
-                               <p>Please <a href="{{path}}mw-config/index.{{ext}}">set up the wiki</a> first.</p>
+                               <p>Please <a href="{{path}}mw-config/index.php">set up the wiki</a> first.</p>
                        {{/installerStarted}}
                {{/localSettingsExists}}
                </div>
        </body>
-</html>
\ No newline at end of file
+</html>
index 514150c..d5c14a2 100644 (file)
@@ -61,7 +61,6 @@ abstract class ResourceLoaderTestCase extends MediaWikiTestCase {
 
                        // For wfScript()
                        'ScriptPath' => '/w',
-                       'ScriptExtension' => '.php',
                        'Script' => '/w/index.php',
                        'LoadScript' => '/w/load.php',
                ];