Revert r38221, 38238 -- "Add new parser function {{apiurl}}. Also, add new global...
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 30 Jul 2008 19:45:35 +0000 (19:45 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 30 Jul 2008 19:45:35 +0000 (19:45 +0000)
I don't really like this in general; the API isn't meant for the UI and there should be little to no call to link to it from body content.

Additionally, I believe we're trying to move all new parser functions to the convention of using the # prefix to avoid conflict with the template namespace.

RELEASE-NOTES
includes/DefaultSettings.php
includes/Setup.php
includes/parser/CoreParserFunctions.php
languages/messages/MessagesEn.php

index aac2744..f2a6209 100644 (file)
@@ -25,9 +25,6 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   empt all content namespaces.)
 * $wgForwardSearchUrl has been removed entirely. Documented setting since 1.4
   has been $wgSearchForwardUrl.
-* $wgApiScript can now be defined if your API isn't named api.php or it's not
-  in the usual location. Setting to false defaults to "$wgScriptPath/api
-  $wgScriptExtension".
 
 === New features in 1.14 ===
 
@@ -39,8 +36,6 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   'EditSectionLinkForOther' hook has been removed, but 'EditSectionLink' is
   run in all cases instead, so extensions using the old hooks should still work
   if they ran roughly the same code for both hooks (as is almost certain).
-* New parser function {{apiurl:}} links to the local API. {{apiurl:help}} would
-  link to action=help. Other params are passed as well.
 
 === Bug fixes in 1.14 ===
 
index 127b81d..e50f662 100644 (file)
@@ -166,7 +166,6 @@ $wgMathPath         = false; ///< defaults to "{$wgUploadPath}/math"
 $wgMathDirectory    = false; ///< defaults to "{$wgUploadDirectory}/math"
 $wgTmpDirectory     = false; ///< defaults to "{$wgUploadDirectory}/tmp"
 $wgUploadBaseUrl    = "";
-$wgApiScript        = false; ///< defaults to "{$wgScriptPath}/api{$wgScriptExtension}"
 /**@}*/
 
 /**
index 5d3322b..cf8aa9b 100644 (file)
@@ -53,7 +53,6 @@ if( $wgTmpDirectory === false ) $wgTmpDirectory = "{$wgUploadDirectory}/tmp";
 
 if( $wgReadOnlyFile === false ) $wgReadOnlyFile = "{$wgUploadDirectory}/lock_yBgMBwiR";
 if( $wgFileCacheDirectory === false ) $wgFileCacheDirectory = "{$wgUploadDirectory}/cache";
-if( $wgApiScript == false ) $wgApiScript = "$wgScriptPath/api$wgScriptExtension";
 
 if ( empty( $wgFileStore['deleted']['directory'] ) ) {
        $wgFileStore['deleted']['directory'] = "{$wgUploadDirectory}/deleted";
index 37a18a2..cce00ab 100644 (file)
@@ -25,7 +25,6 @@ class CoreParserFunctions {
                $parser->setFunctionHook( 'localurle',        array( __CLASS__, 'localurle'        ), SFH_NO_HASH );
                $parser->setFunctionHook( 'fullurl',          array( __CLASS__, 'fullurl'          ), SFH_NO_HASH );
                $parser->setFunctionHook( 'fullurle',         array( __CLASS__, 'fullurle'         ), SFH_NO_HASH );
-               $parser->setFunctionHook( 'apiurl',           array( __CLASS__, 'apiurl'           ), SFH_NO_HASH );
                $parser->setFunctionHook( 'formatnum',        array( __CLASS__, 'formatnum'        ), SFH_NO_HASH );
                $parser->setFunctionHook( 'grammar',          array( __CLASS__, 'grammar'          ), SFH_NO_HASH );
                $parser->setFunctionHook( 'plural',           array( __CLASS__, 'plural'           ), SFH_NO_HASH );
@@ -120,19 +119,6 @@ class CoreParserFunctions {
        static function localurle( $parser, $s = '', $arg = null ) { return self::urlFunction( 'escapeLocalURL', $s, $arg ); }
        static function fullurl( $parser, $s = '', $arg = null ) { return self::urlFunction( 'getFullURL', $s, $arg ); }
        static function fullurle( $parser, $s = '', $arg = null ) { return self::urlFunction( 'escapeFullURL', $s, $arg ); }
-       static function apiurl( $parser, $s = '', $arg = null ) { 
-               global $wgEnableAPI;
-               # Don't bother linking to the API if they can't use it.
-               if ( $wgEnableAPI === false ) {
-                       return array( 'found' => false );
-               }
-               global $wgServer, $wgApiScript;
-               $path = $wgServer . $wgApiScript . '?action=' . $s;
-               if ( !is_null($arg ) ) {
-                       $path .= '&' . $arg;
-               }
-               return $path;
-       }
 
        static function urlFunction( $func, $s = '', $arg = null ) {
                $title = Title::newFromText( $s );
index 405897b..6fe4498 100644 (file)
@@ -312,7 +312,6 @@ $magicWords = array(
        'plural'                 => array( 0,    'PLURAL:'                ),
        'fullurl'                => array( 0,    'FULLURL:'               ),
        'fullurle'               => array( 0,    'FULLURLE:'              ),
-       'apiurl'                 => array( 0,    'APIURL:'                ),
        'lcfirst'                => array( 0,    'LCFIRST:'               ),
        'ucfirst'                => array( 0,    'UCFIRST:'               ),
        'lc'                     => array( 0,    'LC:'                    ),