"Jeremyb" posted a comment on MediaWiki.r113517.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/113517#c32047
Commit summary for MediaWiki.r113517:
add tracking category feature (enabled by default). Each page using this
extension get automatically the tracking category with
MediaWiki:Wikiarticlefeeds-tracking-category name (= RSS authoring page).
Tracking-Cat-Feature can be disabled, or a different MediaWiki message text can
be assigned. Documentation of the switch is inline and follows on MediaWiki.
Jeremyb's comment:
I pointed you to [{{fullurl:Manual:Tag extensions|oldid=503252}}#Example
Manual:Tag extensions#Example] on IRC and you still did not make any attempt at
fixing this yourself. (AFAICT. and you requested a diff)
I made a diff but I'm not sure it's correct (either the MW bits or the php in
general) and you /quit before I finished it.
<syntaxhighlight lang="diff">
From 1c5adc1e0b16d43591a57bfa78bc0e0f0902d896 Mon Sep 17 00:00:00 2001
From: jeremyb
Date: Fri, 9 Mar 2012 21:43:29 +0000
Subject: [PATCH] change per CR comments @ r113517 to match
https://www.mediawiki.org/wiki/Manual:Tag_extensions?oldid=503252#Example
---
WikiArticleFeeds.i18n.magic.php | 2 +-
WikiArticleFeeds_body.php | 14 +++++++-------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/WikiArticleFeeds.i18n.magic.php b/WikiArticleFeeds.i18n.magic.php
index fb42a71..7299650 100644
--- a/WikiArticleFeeds.i18n.magic.php
+++ b/WikiArticleFeeds.i18n.magic.php
@@ -58,4 +58,4 @@ $magicWords['sr-ec'] = array(
/** Serbian (Latin script) (Srpski (latinica)) */
$magicWords['sr-el'] = array(
'itemtags' => array( 0, 'oznakestavke', 'oznake_stavke' ),
-);
\ No newline at end of file
+);
diff --git a/WikiArticleFeeds_body.php b/WikiArticleFeeds_body.php
index 8880048..98906d1 100644
--- a/WikiArticleFeeds_body.php
+++ b/WikiArticleFeeds_body.php
@@ -2,13 +2,13 @@
class WikiArticleFeeds{
- function feedStart( $text, $params = array() ) {
- global $wgParser, $wgWikiArticleFeedsTrackingCategory;
+ function feedStart( $text, $params = array(), Parser $parser) {
+ global $wgWikiArticleFeedsTrackingCategory;
if ( $wgWikiArticleFeedsTrackingCategory === true ) {
- $wgParser->addTrackingCategory(
'wikiarticlefeeds-tracking-category' );
+ $parser->addTrackingCategory(
'wikiarticlefeeds-tracking-category' );
} elseif ( is_string( $wgWikiArticleFeedsTrackingCategory ) ) {
- $wgParser->addTrackingCategory(
$wgWikiArticleFeedsTrackingCategory );
+ $parser->addTrackingCategory(
$wgWikiArticleFeedsTrackingCategory );
}
return '<!-- FEED_START -->';
}
@@ -25,13 +25,13 @@ class WikiArticleFeeds{
return ( $text ? '<!-- ITEM_TAGS ' . base64_encode( serialize(
$text ) ) . ' -->':'' );
}
- function itemTagsFunction( $parser ) {
+ function itemTagsFunction( Parser $parser ) {
$tags = func_get_args();
array_shift( $tags );
return ( !empty( $tags ) ? '<pre>@ITEMTAGS@' . base64_encode(
serialize( implode( ',', $tags ) ) ) . '@ITEMTAGS@</pre>':'' );
}
- function itemTagsPlaceholderCorrections( $parser, &$text ) {
+ function itemTagsPlaceholderCorrections( Parser $parser, &$text ) {
$text = preg_replace(
'|<pre>@ITEMTAGS@([0-9a-zA-Z\\+\\/]+=*)@ITEMTAGS@</pre>|',
'<!-- ITEM_TAGS $1 -->',
@@ -41,7 +41,7 @@ class WikiArticleFeeds{
}
# Sets up the WikiArticleFeeds Parser hooks
- static function wfWikiArticleFeedsSetup( $parser ) {
+ static function wfWikiArticleFeedsSetup( Parser $parser ) {
global $wgWikiArticleFeeds;
$parser->setHook( 'startFeed', array( $wgWikiArticleFeeds,
'feedStart' ) );
--
1.7.2.5
</syntaxhighlight>
_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview