From 75b58962c6b1fa158c31019e8b7d13453d11dddd Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 30 Jul 2008 19:45:35 +0000 Subject: [PATCH] Revert r38221, 38238 -- "Add new parser function {{apiurl}}. Also, add new global $wgApiScript because manually constructing the api script's path seemed like a bad idea." 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 | 5 ----- includes/DefaultSettings.php | 1 - includes/Setup.php | 1 - includes/parser/CoreParserFunctions.php | 14 -------------- languages/messages/MessagesEn.php | 1 - 5 files changed, 22 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index aac2744609..f2a62091eb 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 127b81dace..e50f662b70 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -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}" /**@}*/ /** diff --git a/includes/Setup.php b/includes/Setup.php index 5d3322b24f..cf8aa9b922 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -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"; diff --git a/includes/parser/CoreParserFunctions.php b/includes/parser/CoreParserFunctions.php index 37a18a2d61..cce00ab32c 100644 --- a/includes/parser/CoreParserFunctions.php +++ b/includes/parser/CoreParserFunctions.php @@ -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 ); diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 405897b40e..6fe4498a24 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -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:' ), -- 2.20.1