(bug 35685) Add section with entry point URLs to Special:Version
authorCatrope <roan.kattouw@gmail.com>
Thu, 12 Apr 2012 06:10:11 +0000 (23:10 -0700)
committerCatrope <roan.kattouw@gmail.com>
Thu, 19 Apr 2012 18:17:13 +0000 (11:17 -0700)
This'll make it easier for people to figure out where api.php is, and it
should help debug bad settings for $wgArticlePath/$wgScriptPath too.

Patchset 2: address review comments
Patchset 3: rebased to fix conflict in RELEASE-NOTES-1.20
Patchset 4: [Sam] whitespace
Patchset 5: moved down entry points list, fixed mw.org Manual: links
Patchset 6: rebased for another RELEASE-NOTES-1.20 conflict

Change-Id: I86eb84aca38abe214dfa3c3aeb3a9b6e586c8602

RELEASE-NOTES-1.20
includes/specials/SpecialVersion.php
languages/messages/MessagesEn.php
languages/messages/MessagesQqq.php
maintenance/language/messages.inc

index 9f9c380..9722f48 100644 (file)
@@ -42,6 +42,8 @@ production.
   repository viewer linked to from Special:Version.
 * Memcached debug logs can now be sent to their own file logs by setting
   $wgDebugLogFile['memcached'] to some filepath.
+* (bug 35685) api.php URL and other entry point URLs are now listed on
+  Special:Version
 
 === Bug fixes in 1.20 ===
 * (bug 30245) Use the correct way to construct a log page title.
index d0e7ed9..2b4dc95 100644 (file)
@@ -58,6 +58,7 @@ class SpecialVersion extends SpecialPage {
                $text =
                        $this->getMediaWikiCredits() .
                        $this->softwareInformation() .
+                       $this->getEntryPointInfo() .
                        $this->getExtensionCredits();
                if ( $wgSpecialVersionShowHooks ) {
                        $text .= $this->getWgHooks();
@@ -739,6 +740,41 @@ class SpecialVersion extends SpecialPage {
                return $repo->getHeadSHA1();
        }
 
+       /**
+        * Get the list of entry points and their URLs
+        * @return string Wikitext
+        */
+       public function getEntryPointInfo() {
+               global $wgArticlePath, $wgScriptPath;
+               $entryPoints = array(
+                       'version-entrypoints-articlepath' => $wgArticlePath,
+                       'version-entrypoints-scriptpath' => $wgScriptPath,
+                       'version-entrypoints-index-php' => wfScript( 'index' ),
+                       'version-entrypoints-api-php' => wfScript( 'api' ),
+                       'version-entrypoints-load-php' => wfScript( 'load' ),
+               );
+
+               $out = Html::element( 'h2', array( 'id' => 'mw-version-entrypoints' ), wfMsg( 'version-entrypoints' ) ) .
+                       Html::openElement( 'table', array( 'class' => 'wikitable', 'id' => 'mw-version-entrypoints-table' ) ) .
+                       Html::openElement( 'tr' ) .
+                       Html::element( 'th', array(), wfMessage( 'version-entrypoints-header-entrypoint' )->text() ) .
+                       Html::element( 'th', array(), wfMessage( 'version-entrypoints-header-url' )->text() ) .
+                       Html::closeElement( 'tr' );
+
+               foreach ( $entryPoints as $message => $value ) {
+                       $url = wfExpandUrl( $value, PROTO_RELATIVE );
+                       $out .= Html::openElement( 'tr' ) .
+                               // ->text() looks like it should be ->parse(), but this function
+                               // returns wikitext, not HTML, boo
+                               Html::rawElement( 'td', array(), wfMessage( $message )->text() ) .
+                               Html::rawElement( 'td', array(), Html::rawElement( 'code', array(), "[$url $value]" ) ) .
+                               Html::closeElement( 'tr' );
+               }
+
+               $out .= Html::closeElement( 'table' );
+               return $out;
+       }
+
        function showEasterEgg() {
                $rx = $rp = $xe = '';
                $alpha = array("", "kbQW", "\$\n()");
index 01b8c14..cb43223 100644 (file)
@@ -4622,6 +4622,14 @@ You should have received [{{SERVER}}{{SCRIPTPATH}}/COPYING a copy of the GNU Gen
 'version-software'              => 'Installed software',
 'version-software-product'      => 'Product',
 'version-software-version'      => 'Version',
+'version-entrypoints'           => 'Entry point URLs',
+'version-entrypoints-header-entrypoint' => 'Entry point',
+'version-entrypoints-header-url' => 'URL',
+'version-entrypoints-articlepath' => '[https://www.mediawiki.org/wiki/Manual:$wgArticlePath Article path]',
+'version-entrypoints-scriptpath' => '[https://www.mediawiki.org/wiki/Manual:$wgScriptPath Script path]',
+'version-entrypoints-index-php' => '[https://www.mediawiki.org/wiki/Manual:index.php index.php]',
+'version-entrypoints-api-php'   => '[https://www.mediawiki.org/wiki/Manual:api.php api.php]',
+'version-entrypoints-load-php'  => '[https://www.mediawiki.org/wiki/Manual:load.php load.php]',
 
 # Special:FilePath
 'filepath'         => 'File path',
index 7f7e967..c36f707 100644 (file)
@@ -4413,6 +4413,14 @@ This is being used in [[Special:Version]], preceeding the subversion revision nu
 'version-license-info' => '[[wikipedia:GNU GPL|GNU GPL]] notice shown at [[Special:Version]]. See //www.gnu.org/licenses/old-licenses/gpl-2.0-translations.html for available translations.',
 'version-software-product' => 'Shown in [[Special:Version]]',
 'version-software-version' => '{{Identical|Version}}',
+'version-entrypoints' => 'Header on [[Special:Version]] above a table that lists the URLs of various entry points in this MediaWiki installation.',
+'version-entrypoints-header-entrypoint' => 'Header for the first column in the entry points table on [[Special:Version]].',
+'version-entrypoints-header-url' => 'Header for the second column in the entry points table on [[Special:Version]].',
+'version-entrypoints-articlepath' => 'A short description of the article path entry point. Links to the mediawiki.org documentation page for $wgArticlePath.',
+'version-entrypoints-scriptpath' => 'A short description of the script path entry point. Links to the mediawiki.org documentation page for $wgScriptPath.',
+'version-entrypoints-index-php' => 'A short description of the index.php entry point. Links to the mediawiki.org documentation page for index.php.',
+'version-entrypoints-api-php'   => 'A short description of the api.php entry point. Links to the mediawiki.org documentation page for api.php.',
+'version-entrypoints-load-php'  => 'A short description of the load.php entry point. Links to the mediawiki.org documentation page for load.php.',
 
 # Special:FilePath
 'filepath' => 'Legend of fieldset around input box in [[Special:FilePath]].',
index 40cfad3..0083f20 100644 (file)
@@ -3488,6 +3488,14 @@ $wgMessageStructure = array(
                'version-software',
                'version-software-product',
                'version-software-version',
+               'version-entrypoints',
+               'version-entrypoints-header-entrypoint',
+               'version-entrypoints-header-url',
+               'version-entrypoints-articlepath',
+               'version-entrypoints-scriptpath',
+               'version-entrypoints-index-php',
+               'version-entrypoints-api-php',
+               'version-entrypoints-load-php',
        ),
        'filepath' => array(
                'filepath',