r112633 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112632‎ | r112633 | r112634 >
Date:20:43, 28 February 2012
Author:danwe
Status:deferred
Tags:
Comment:
Repaired CALLER parser function after it was broken in r109525. Changed version to "0.3 alpha", changed http links to https
Modified paths:
  • /trunk/extensions/ParserFun/ParserFun.php (modified) (history)
  • /trunk/extensions/ParserFun/README (modified) (history)
  • /trunk/extensions/ParserFun/RELEASE-NOTES (modified) (history)
  • /trunk/extensions/ParserFun/includes/PFun_Caller.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ParserFun/RELEASE-NOTES
@@ -1,6 +1,9 @@
22 'Parser Fun' Changelog:
33 =======================
44
 5+ * Version 0.3
 6+ ~~ THIS IS NOT A FINAL RELEASE YET ~~
 7+
58 * December 9, 2011 -- Version 0.2
69 - New parser function/variable 'CALLER' to return a templates caller. Comes with the following parameters:
710 + <1>/mode - can be the level of the call stack to return (if negative the value will be returned from the
Index: trunk/extensions/ParserFun/includes/PFun_Caller.php
@@ -22,7 +22,7 @@
2323 */
2424 public static function staticInit( Parser &$parser ) {
2525 global $egParserFunEnabledFunctions;
26 - if( in_array( ExtParserFun::MAG_CALLER, $egParserFunEnabledFunctions ) ) {
 26+ if( in_array( 'caller', $egParserFunEnabledFunctions ) ) {
2727 // only register function if not disabled by configuration
2828 $instance = new self;
2929 $instance->init( $parser );
@@ -37,7 +37,7 @@
3838 * @return string
3939 */
4040 protected function getName() {
41 - return 'CALLER';
 41+ return 'caller';
4242 }
4343
4444 /**
Index: trunk/extensions/ParserFun/ParserFun.php
@@ -4,11 +4,11 @@
55 * 'Parser Fun' adds a parser function '#parse' for parsing wikitext and introduces the
66 * 'THIS:' prefix for page information related magic variables
77 *
8 - * Documentation: http://www.mediawiki.org/wiki/Extension:Parser_Fun
9 - * Support: http://www.mediawiki.org/wiki/Extension_talk:Parser_Fun
10 - * Source code: http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/ParserFun
 8+ * Documentation: https://www.mediawiki.org/wiki/Extension:Parser_Fun
 9+ * Support: https://www.mediawiki.org/wiki/Extension_talk:Parser_Fun
 10+ * Source code: https://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/ParserFun
1111 *
12 - * @version: 0.2
 12+ * @version: 0.3 alpha
1313 * @license: ISC license
1414 * @author: Daniel Werner < danweetz@web.de >
1515 *
@@ -27,7 +27,7 @@
2828
2929 // Only initialize the extension when Validator extension is present:
3030 if ( ! defined( 'Validator_VERSION' ) ) {
31 - die( '<p><b>Error:</b> You need to have <a href="http://www.mediawiki.org/wiki/Extension:Validator">Validator</a> installed in order to use <a href="http://www.mediawiki.org/wiki/Extension:Parse">Parse</a>.</p>' );
 31+ die( '<p><b>Error:</b> You need to have <a href="https://www.mediawiki.org/wiki/Extension:Validator">Validator</a> installed in order to use <a href="https://www.mediawiki.org/wiki/Extension:Parse">Parse</a>.</p>' );
3232 }
3333
3434
@@ -37,7 +37,7 @@
3838 'name' => 'Parser Fun',
3939 'descriptionmsg' => 'parserfun-desc',
4040 'version' => ExtParserFun::VERSION,
41 - 'author' => '[http://www.mediawiki.org/wiki/User:Danwe Daniel Werner]',
 41+ 'author' => '[https://www.mediawiki.org/wiki/User:Danwe Daniel Werner]',
4242 'url' => 'https://www.mediawiki.org/wiki/Extension:Parser_Fun',
4343 );
4444
@@ -78,7 +78,7 @@
7979 *
8080 * @var string
8181 */
82 - const VERSION = '0.3';
 82+ const VERSION = '0.3 alpha';
8383
8484 static function init( Parser &$parser ) {
8585 if( self::isEnabledFunction( 'this' ) ) {
@@ -93,7 +93,7 @@
9494 *
9595 * @since 0.2
9696 *
97 - * @param type $word
 97+ * @param string $word
9898 * @return bool
9999 */
100100 static function isEnabledFunction( $word ) {
@@ -106,7 +106,7 @@
107107 *
108108 * @since 0.1
109109 *
110 - * @return boolean
 110+ * @return string
111111 */
112112 static function getDir() {
113113 static $dir = null;
Index: trunk/extensions/ParserFun/README
@@ -19,9 +19,9 @@
2020 as well as their URL-encoded equivalents ending with 'EE'.
2121 It is possible for other extensions to support the 'THIS:' prefix, currently:
2222 - All 'Subpage Fun' extension variables:
23 - http://www.mediawiki.org/wiki/Extension:Subpage_Fun
 23+ https://www.mediawiki.org/wiki/Extension:Subpage_Fun
2424
25 -* Website: http://www.mediawiki.org/wiki/Extension:Parser_Fun
 25+* Website: https://www.mediawiki.org/wiki/Extension:Parser_Fun
2626 * Author: Daniel Werner < danweetz@web.de >
2727
2828
@@ -44,4 +44,4 @@
4545 If you have bug reports or feature requests, please add them to the 'Parser Fun'
4646 Talk page [0]. You can also send them to Daniel Werner < danweetz@web.de >
4747
48 -[0] http://www.mediawiki.org/w/index.php?title=Extension_talk:Parser_Fun
 48+[0] https://www.mediawiki.org/w/index.php?title=Extension_talk:Parser_Fun

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r109525Remove use of deprecated LanguageGetMagic hook....siebrand12:16, 19 January 2012

Status & tagging log